Skip to content
Snippets Groups Projects
Commit b948db03 authored by Marc Rene Arns's avatar Marc Rene Arns
Browse files

moving to gitlab

parent 4751d32e
No related branches found
No related tags found
No related merge requests found
......@@ -11,5 +11,4 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
_example/example
_example/_example
\ No newline at end of file
example/example
\ No newline at end of file
......@@ -4,10 +4,10 @@
## Purpose
A driver for the unified MIDI driver interface at https://github.com/gomidi/connect .
A driver for the unified MIDI driver interface https://gitlab.com/gomidi/midi/mid.Driver .
This driver is based on the rtmidi project (see https://github.com/thestk/rtmidi for more information).
For a driver based on portmidi, see https://github.com/gomidi/portmididrv
For a driver based on portmidi, see https://gitlab.com/gomidi/portmididrv
## Installation
......@@ -17,12 +17,12 @@ It is recommended to use Go 1.11 with module support (`$GO111MODULE=on`).
```
// install the headers of alsa somehow, e.g. sudo apt-get install libasound2-dev
go get -d github.com/gomidi/rtmididrv
go get -d gitlab.com/gomidi/rtmididrv
```
## Documentation
[![rtmididrv docs](http://godoc.org/github.com/gomidi/rtmididrv?status.png)](http://godoc.org/github.com/gomidi/rtmididrv)
[![rtmididrv docs](http://godoc.org/gitlab.com/gomidi/rtmididrv?status.png)](http://godoc.org/gitlab.com/gomidi/rtmididrv)
## Example
......@@ -35,9 +35,8 @@ import (
"os"
"time"
"github.com/gomidi/connect"
"github.com/gomidi/mid"
driver "github.com/gomidi/rtmididrv"
"gitlab.com/gomidi/midi/mid"
driver "gitlab.com/gomidi/rtmididrv"
)
func must(err error) {
......@@ -96,11 +95,11 @@ func main() {
}
}
func printPort(port connect.Port) {
func printPort(port mid.Port) {
fmt.Printf("[%v] %s\n", port.Number(), port.String())
}
func printInPorts(ports []connect.In) {
func printInPorts(ports []mid.In) {
fmt.Printf("MIDI IN Ports\n")
for _, port := range ports {
printPort(port)
......@@ -108,7 +107,7 @@ func printInPorts(ports []connect.In) {
fmt.Printf("\n\n")
}
func printOutPorts(ports []connect.Out) {
func printOutPorts(ports []mid.Out) {
fmt.Printf("MIDI OUT Ports\n")
for _, port := range ports {
printPort(port)
......
module github.com/gomidi/rtmididrv/_example
replace github.com/gomidi/rtmididrv => ../
require (
github.com/gomidi/connect v0.11.1
github.com/gomidi/mid v0.17.0
github.com/gomidi/rtmididrv v0.0.10
)
github.com/gomidi/cc v0.2.0 h1:2IRNKQvLFl1nq974v0psFYBBzn95ZceNeKxK2eByFc8=
github.com/gomidi/cc v0.2.0/go.mod h1:pp/v4mQ8/Z6O7KoGukAO9MNQ5nhUUgAJlJU7XsC4IpI=
github.com/gomidi/connect v0.9.0 h1:UpX2PBl3660JEpKk2Q3uwuLsbc2AVoySBVkwTGbHyAA=
github.com/gomidi/connect v0.9.0/go.mod h1:zu6PoN7Xs/37thtXZ+4Wl1MMg8MxenS7U/M3rn6trNo=
github.com/gomidi/connect v0.10.0 h1:8oym4O321D4hbN/DW4NwEDpF5P0IuMK3JZThc/Y1SDA=
github.com/gomidi/connect v0.10.0/go.mod h1:zu6PoN7Xs/37thtXZ+4Wl1MMg8MxenS7U/M3rn6trNo=
github.com/gomidi/connect v0.11.1 h1:3u5nXHSUDCj1CkhiY3hes+QzTg//gSD3gUVA5eTythU=
github.com/gomidi/connect v0.11.1/go.mod h1:zu6PoN7Xs/37thtXZ+4Wl1MMg8MxenS7U/M3rn6trNo=
github.com/gomidi/mid v0.15.0 h1:UkHzHi5dArERz0ULxSciYwjLce8mZMG9mMFoafCycds=
github.com/gomidi/mid v0.15.0/go.mod h1:eudyOHRUnIZ+Ikl4umKxYLjsSiYqrcF3zHfct3xRAuQ=
github.com/gomidi/mid v0.16.0 h1:itROhVvGxWHa+J9fpBjc2HOlJKlmIBxVHp2kmy0BVeI=
github.com/gomidi/mid v0.16.0/go.mod h1:cg3EEV8BEbgw2/3ij1pDof5J9bONxQWldktqX2Ahw8w=
github.com/gomidi/mid v0.16.1 h1:mbvRKRC7Joi5raPX3J9acF0V9LHvyxgU2vy+m8r288Q=
github.com/gomidi/mid v0.16.1/go.mod h1:W3yGoOUT0nWmcNUhaP5KDDWPs9HYfe/VPrH1sniz+dQ=
github.com/gomidi/mid v0.17.0 h1:gVc21J4lTqIqdI61ZHtvbrflH0Tf9jmCyqfAwcEacJs=
github.com/gomidi/mid v0.17.0/go.mod h1:CRgJg/zXQWthyz6SOjuTK4E089G1QNcd9pARxQXAAeQ=
github.com/gomidi/midi v1.4.1 h1:eRaiAALXTnzffQu8ShfaT7ZoINRHwK+yubgpGb8RA2c=
github.com/gomidi/midi v1.4.1/go.mod h1:B16DbgtsXSbQK9Q75aVezVL6VGhaK+2CVe/ybwUUCHE=
github.com/gomidi/midi v1.4.2 h1:vU5m8n5iJjDEF8pqEcox/6Jw2IBHACtR30EBc0IyQls=
github.com/gomidi/midi v1.4.2/go.mod h1:B16DbgtsXSbQK9Q75aVezVL6VGhaK+2CVe/ybwUUCHE=
github.com/gomidi/midi v1.6.0 h1:g/aUVDRfFKzCIvmlI2MRc6IKopKdBno2bBb/2a4RYmo=
github.com/gomidi/midi v1.6.0/go.mod h1:B16DbgtsXSbQK9Q75aVezVL6VGhaK+2CVe/ybwUUCHE=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180902095240-24e991c33977 h1:oa7DQlszTe85tEfmUgSkA8C6Wb6SMuiLoD72Q32Spq4=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180902095240-24e991c33977/go.mod h1:dbXfsHh+fNtafItiJIgnK6EMw5M/xgtXc7Rmya+cZsQ=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180902095739-8a232e64bf74 h1:RJYjVzacpS4aPBS8lC1K9DZ7366kaUkXTT+GqSted+M=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180902095739-8a232e64bf74/go.mod h1:dbXfsHh+fNtafItiJIgnK6EMw5M/xgtXc7Rmya+cZsQ=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180903191816-feb86b14a13c h1:FcWvQiaRF5j4FZDSe1ifp6MS326uR1xYHhIuPIMJABM=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180903191816-feb86b14a13c/go.mod h1:dbXfsHh+fNtafItiJIgnK6EMw5M/xgtXc7Rmya+cZsQ=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180903192224-c212a44b13e6/go.mod h1:dbXfsHh+fNtafItiJIgnK6EMw5M/xgtXc7Rmya+cZsQ=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180920083105-a31b053b8058 h1:/qv3T1spERrM4WesipavZo2MBEtjzRSVDKRwHWoGc38=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20180920083105-a31b053b8058/go.mod h1:dbXfsHh+fNtafItiJIgnK6EMw5M/xgtXc7Rmya+cZsQ=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20181003214813-394e08a8a616 h1:li36X3RHhnh40a0jGULcNryHKFEKZrf++Vfj0NpfRVM=
github.com/gomidi/rtmididrv/imported/rtmidi v0.0.0-20181003214813-394e08a8a616/go.mod h1:dbXfsHh+fNtafItiJIgnK6EMw5M/xgtXc7Rmya+cZsQ=
......@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
Package rtmididrv provides a gomidi/connect/Driver to connect gomidi/mid with external MIDI ports via rtmidi.
Package rtmididrv provides a gomidi/midi/mid.Driver to connect to external MIDI ports via rtmidi.
See the example to get an idea how to use it.
*/
......
......@@ -4,14 +4,14 @@ import (
"fmt"
"sync"
"github.com/gomidi/connect"
"github.com/gomidi/rtmididrv/imported/rtmidi"
"gitlab.com/gomidi/midi/mid"
"gitlab.com/gomidi/rtmididrv/imported/rtmidi"
// "github.com/metakeule/mutex"
)
type driver struct {
debug bool
opened []connect.Port
opened []mid.Port
sync.RWMutex
// mutex.RWMutex
closed bool
......@@ -27,7 +27,7 @@ func (d *driver) Close() (err error) {
d.RLock()
if d.closed {
d.RUnlock()
return connect.ErrClosed
return mid.ErrClosed
}
d.RUnlock()
......@@ -57,7 +57,7 @@ func (d *driver) Close() (err error) {
// New returns a driver based on the default rtmidi in and out
//func New(debug bool) (connect.Driver, error) {
func New() (connect.Driver, error) {
func New() (mid.Driver, error) {
//d := &driver{debug: debug}
d := &driver{}
// d.RWMutex = mutex.NewRWMutex("rtmididrv driver", debug)
......@@ -65,12 +65,12 @@ func New() (connect.Driver, error) {
}
// Ins returns the available MIDI input ports
func (d *driver) Ins() (ins []connect.In, err error) {
func (d *driver) Ins() (ins []mid.In, err error) {
d.Lock()
defer d.Unlock()
if d.closed {
return nil, connect.ErrClosed
return nil, mid.ErrClosed
}
in, err := rtmidi.NewMIDIInDefault()
if err != nil {
......@@ -95,12 +95,12 @@ func (d *driver) Ins() (ins []connect.In, err error) {
}
// Outs returns the available MIDI output ports
func (d *driver) Outs() (outs []connect.Out, err error) {
func (d *driver) Outs() (outs []mid.Out, err error) {
d.Lock()
defer d.Unlock()
if d.closed {
return nil, connect.ErrClosed
return nil, mid.ErrClosed
}
out, err := rtmidi.NewMIDIOutDefault()
if err != nil {
......
......@@ -5,9 +5,8 @@ import (
"os"
"time"
"github.com/gomidi/connect"
"github.com/gomidi/mid"
"github.com/gomidi/rtmididrv"
"gitlab.com/gomidi/midi/mid"
"gitlab.com/gomidi/rtmididrv"
)
func must(err error) {
......@@ -66,11 +65,11 @@ func main() {
}
}
func printPort(port connect.Port) {
func printPort(port mid.Port) {
fmt.Printf("[%v] %s\n", port.Number(), port.String())
}
func printInPorts(ports []connect.In) {
func printInPorts(ports []mid.In) {
fmt.Printf("MIDI IN Ports\n")
for _, port := range ports {
printPort(port)
......@@ -78,7 +77,7 @@ func printInPorts(ports []connect.In) {
fmt.Printf("\n\n")
}
func printOutPorts(ports []connect.Out) {
func printOutPorts(ports []mid.Out) {
fmt.Printf("MIDI OUT Ports\n")
for _, port := range ports {
printPort(port)
......
......@@ -5,8 +5,8 @@ import (
"math"
"sync"
"github.com/gomidi/connect"
"github.com/gomidi/rtmididrv/imported/rtmidi"
"gitlab.com/gomidi/midi/mid"
"gitlab.com/gomidi/rtmididrv/imported/rtmidi"
// "github.com/metakeule/mutex"
)
......@@ -104,7 +104,7 @@ func (i *in) Open() (err error) {
return nil
}
func newIn(debug bool, driver *driver, number int, name string) connect.In {
func newIn(debug bool, driver *driver, number int, name string) mid.In {
i := &in{driver: driver, number: number, name: name}
// i.RWMutex = mutex.NewRWMutex("rtmididrv in port "+name, debug)
return i
......@@ -115,7 +115,7 @@ func (i *in) SetListener(listener func(data []byte, deltaMicroseconds int64)) (e
i.RLock()
if i.closed || i.midiIn == nil {
i.RUnlock()
return connect.ErrClosed
return mid.ErrClosed
}
if i.listenerSet {
......@@ -147,7 +147,7 @@ func (i *in) StopListening() error {
i.RLock()
if i.closed || i.midiIn == nil {
i.RUnlock()
return connect.ErrClosed
return mid.ErrClosed
}
i.RUnlock()
i.Lock()
......
......@@ -5,12 +5,12 @@ import (
"sync"
"time"
"github.com/gomidi/connect"
"github.com/gomidi/rtmididrv/imported/rtmidi"
"gitlab.com/gomidi/midi/mid"
"gitlab.com/gomidi/rtmididrv/imported/rtmidi"
// "github.com/metakeule/mutex"
)
func newOut(debug bool, driver *driver, number int, name string) connect.Out {
func newOut(debug bool, driver *driver, number int, name string) mid.Out {
o := &out{driver: driver, number: number, name: name}
// o.RWMutex = mutex.NewRWMutex("rtmididrv out port "+name, debug)
return o
......@@ -35,14 +35,14 @@ func (o *out) IsOpen() (open bool) {
}
// Send sends a message to the MIDI out port
// If the out port is closed, it returns connect.ErrClosed
// If the out port is closed, it returns mid.ErrClosed
func (o *out) Send(b []byte) error {
//o.RLock()
o.Lock()
defer o.Unlock()
if o.closed || o.midiOut == nil {
//o.RUnlock()
return connect.ErrClosed
return mid.ErrClosed
}
// o.RUnlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment