Skip to content

Commit

Permalink
mog -> moggio
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyblue committed Mar 1, 2016
1 parent 6564622 commit d2adf5c
Show file tree
Hide file tree
Showing 40 changed files with 850 additions and 792 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mog
# moggio

An audio player written in Go.

Expand Down
2 changes: 1 addition & 1 deletion app/app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
application: mog-music-client
application: moggio-music-client
version: 1
runtime: go
api_version: go1
Expand Down
2 changes: 1 addition & 1 deletion app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/mjibson/appstats"
"github.com/mjibson/goon"
"github.com/mjibson/mog/models"
"github.com/mjibson/moggio/models"
"golang.org/x/net/context"
"google.golang.org/appengine/datastore"
"google.golang.org/appengine/user"
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ -z "$1" ]; then
exit
fi

docker build -t mjibson/mog .
docker build -t mjibson/moggio .

DIR=/go/src/github.com/mjibson/mog
docker run --rm -v "$(pwd)":$DIR -w $DIR mjibson/mog sh docker.sh $1
DIR=/go/src/github.com/mjibson/moggio
docker run --rm -v "$(pwd)":$DIR -w $DIR mjibson/moggio sh docker.sh $1
2 changes: 1 addition & 1 deletion codec/flac/flac.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"time"

"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
"gopkg.in/mewkiz/flac.v1"
"gopkg.in/mewkiz/flac.v1/frame"
"gopkg.in/mewkiz/flac.v1/meta"
Expand Down
2 changes: 1 addition & 1 deletion codec/gme/gme.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"

"github.com/mjibson/gme"
"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion codec/mpa/mpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/dhowden/tag"
"github.com/korandiz/mpa"
"github.com/korandiz/mpseek"
"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion codec/nsf/nsf.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"strconv"

"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/nsf"
)

Expand Down
2 changes: 1 addition & 1 deletion codec/rar/rar.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"io/ioutil"

"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
"github.com/nwaples/rardecode"
)

Expand Down
2 changes: 1 addition & 1 deletion codec/vorbis/vorbis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/dhowden/tag"
"github.com/mccoyst/vorbis"
"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion codec/wav/wav.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io/ioutil"

"github.com/mjibson/go-dsp/wav"
"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build()
EXT=".exe"
fi
echo $GOOS $GOARCH $EXT
go build -o mog-$GOOS-$GOARCH$EXT -ldflags "-X github.com/mjibson/mog/server.MogVersion=$ver"
go build -o moggio-$GOOS-$GOARCH$EXT -ldflags "-X github.com/mjibson/moggio/server.MoggioVersion=$ver"
}

go version
Expand Down
12 changes: 6 additions & 6 deletions mac-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

APPNAME=mog
APPNAME=moggio
DIR="$APPNAME.app/Contents/MacOS"
OUTPUT="$DIR/$APPNAME"
PA=libportaudio.2.dylib
Expand All @@ -21,11 +21,11 @@ cat > $DIR/../Info.plist << EOF
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>mog</string>
<string>moggio</string>
<key>CFBundleIdentifier</key>
<string>io.mog.Mog</string>
<string>io.moggio.Moggio</string>
<key>CFBundleName</key>
<string>mog</string>
<string>moggio</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
Expand All @@ -34,5 +34,5 @@ cat > $DIR/../Info.plist << EOF
</plist>
EOF

rm -f mog.zip
zip mog -r mog.app
rm -f moggio.zip
zip moggio -r moggio.app
44 changes: 22 additions & 22 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ import (
"time"

"github.com/facebookgo/httpcontrol"
"github.com/mjibson/mog/server"
"github.com/mjibson/moggio/server"
"gopkg.in/fsnotify.v1"

// codecs
_ "github.com/mjibson/mog/codec/flac"
_ "github.com/mjibson/mog/codec/gme"
_ "github.com/mjibson/mog/codec/mpa"
_ "github.com/mjibson/mog/codec/nsf"
_ "github.com/mjibson/mog/codec/rar"
_ "github.com/mjibson/mog/codec/vorbis"
_ "github.com/mjibson/mog/codec/wav"
_ "github.com/mjibson/moggio/codec/flac"
_ "github.com/mjibson/moggio/codec/gme"
_ "github.com/mjibson/moggio/codec/mpa"
_ "github.com/mjibson/moggio/codec/nsf"
_ "github.com/mjibson/moggio/codec/rar"
_ "github.com/mjibson/moggio/codec/vorbis"
_ "github.com/mjibson/moggio/codec/wav"

// protocols
_ "github.com/mjibson/mog/protocol/bandcamp"
"github.com/mjibson/mog/protocol/drive"
"github.com/mjibson/mog/protocol/dropbox"
_ "github.com/mjibson/mog/protocol/file"
_ "github.com/mjibson/mog/protocol/gmusic"
"github.com/mjibson/mog/protocol/soundcloud"
_ "github.com/mjibson/mog/protocol/stream"
_ "github.com/mjibson/moggio/protocol/bandcamp"
"github.com/mjibson/moggio/protocol/drive"
"github.com/mjibson/moggio/protocol/dropbox"
_ "github.com/mjibson/moggio/protocol/file"
_ "github.com/mjibson/moggio/protocol/gmusic"
"github.com/mjibson/moggio/protocol/soundcloud"
_ "github.com/mjibson/moggio/protocol/stream"
)

var (
Expand All @@ -42,7 +42,7 @@ var (
flagDropbox = flag.String("dropbox", "rnhpqsbed2q2ezn:ldref688unj74ld", "Dropbox API credentials of the form ClientID:ClientSecret")
flagSoundcloud = flag.String("soundcloud", "ec28c2226a0838d01edc6ed0014e462e:a115e94029d698f541960c8dc8560978", "SoundCloud API credentials of the form ClientID:ClientSecret")
flagDev = flag.Bool("dev", false, "enable dev mode")
//flagCentral = flag.String("central", "https://mog-music-client.appspot.com", "Central Mog data server; empty to disable")
//flagCentral = flag.String("central", "https://moggio-music-client.appspot.com", "Central Moggio data server; empty to disable")
stateFile = flag.String("state", "", "specify non-default statefile location")
)

Expand Down Expand Up @@ -88,15 +88,15 @@ func main() {
if *stateFile == "" {
switch {
case *flagDev:
*stateFile = "mog.state"
*stateFile = "moggio.state"
case runtime.GOOS == "windows":
dir := filepath.Join(os.Getenv("APPDATA"), "mog")
dir := filepath.Join(os.Getenv("APPDATA"), "moggio")
if err := os.MkdirAll(dir, 0600); err != nil {
log.Fatal(err)
}
*stateFile = filepath.Join(dir, "mog.state")
*stateFile = filepath.Join(dir, "moggio.state")
default:
*stateFile = filepath.Join(os.Getenv("HOME"), ".mog.state")
*stateFile = filepath.Join(os.Getenv("HOME"), ".moggio.state")
}
}
log.Fatal(server.ListenAndServe(*stateFile, *flagAddr, "", *flagDev))
Expand All @@ -114,7 +114,7 @@ func browserify() {
c := exec.Command("watchify",
"-t", "[", "reactify", "--es6", "]",
filepath.Join(src, "nav.js"),
"-o", filepath.Join(js, "mog.js"),
"-o", filepath.Join(js, "moggio.js"),
"--verbose",
)
c.Stderr = os.Stderr
Expand Down Expand Up @@ -188,5 +188,5 @@ func watch(root, pattern string, f func()) {
}()
}

//go:generate browserify -t [ reactify --es6 ] server/static/src/nav.js -o server/static/js/mog.js
//go:generate browserify -t [ reactify --es6 ] server/static/src/nav.js -o server/static/js/moggio.js
//go:generate esc -o server/static.go -pkg server -prefix server server/static/index.html server/static/css server/static/fonts server/static/js
2 changes: 1 addition & 1 deletion output/pulse.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func get(sampleRate, channels int) (Output, error) {
o := new(output)
var err error
ss := pulse.SampleSpec{pulse.SAMPLE_FLOAT32LE, uint32(sampleRate), uint8(channels)}
o.st, err = pulse.Playback("mog", "mog", &ss)
o.st, err = pulse.Playback("moggio", "moggio", &ss)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions protocol/bandcamp/bandcamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"strings"
"time"

"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/codec/mpa"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/codec/mpa"
"github.com/mjibson/moggio/protocol"
"golang.org/x/oauth2"
)

Expand Down
4 changes: 2 additions & 2 deletions protocol/drive/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"log"
"reflect"

"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/protocol"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/drive/v3"
Expand Down
6 changes: 3 additions & 3 deletions protocol/dropbox/dropbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"path"
"reflect"

"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/mog/protocol/dropbox/dropbox"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/protocol"
"github.com/mjibson/moggio/protocol/dropbox/dropbox"
"golang.org/x/oauth2"
)

Expand Down
4 changes: 2 additions & 2 deletions protocol/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"path/filepath"
"reflect"

"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/protocol"
"golang.org/x/oauth2"
)

Expand Down
6 changes: 3 additions & 3 deletions protocol/gmusic/gmusic.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"github.com/mjibson/gmusic"
"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/codec/mpa"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/codec/mpa"
"github.com/mjibson/moggio/protocol"
"golang.org/x/oauth2"
)

Expand Down
2 changes: 1 addition & 1 deletion protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"reflect"

"github.com/mjibson/mog/codec"
"github.com/mjibson/moggio/codec"
"golang.org/x/oauth2"
)

Expand Down
8 changes: 4 additions & 4 deletions protocol/soundcloud/soundcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"reflect"
"time"

"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/codec/mpa"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/mog/protocol/soundcloud/soundcloud"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/codec/mpa"
"github.com/mjibson/moggio/protocol"
"github.com/mjibson/moggio/protocol/soundcloud/soundcloud"
"golang.org/x/oauth2"
"google.golang.org/api/googleapi"
)
Expand Down
6 changes: 3 additions & 3 deletions protocol/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"strings"
"time"

"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/codec/mpa"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/codec/mpa"
"github.com/mjibson/moggio/protocol"
"golang.org/x/oauth2"
)

Expand Down
4 changes: 2 additions & 2 deletions server/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"time"

"github.com/mjibson/mog/output"
"github.com/mjibson/moggio/output"
)

func (srv *Server) audio() {
Expand Down Expand Up @@ -59,7 +59,7 @@ func (srv *Server) audio() {
setParams := func(c audioSetParams) {
out, err = output.Get(c.sr, c.ch)
if err != nil {
c.err <- fmt.Errorf("mog: could not open audio (%v, %v): %v", c.sr, c.ch, err)
c.err <- fmt.Errorf("moggio: could not open audio (%v, %v): %v", c.sr, c.ch, err)
return
}
dur = time.Second / (time.Duration(c.sr * c.ch))
Expand Down
6 changes: 3 additions & 3 deletions server/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"time"

"github.com/bradfitz/slice"
"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/models"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/models"
"github.com/mjibson/moggio/protocol"
"golang.org/x/net/websocket"
"golang.org/x/oauth2"
)
Expand Down
6 changes: 3 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package server implements the mog protocol.
// Package server implements the moggio protocol.
package server

import (
Expand All @@ -23,8 +23,8 @@ import (
"time"

"github.com/boltdb/bolt"
"github.com/mjibson/mog/codec"
"github.com/mjibson/mog/protocol"
"github.com/mjibson/moggio/codec"
"github.com/mjibson/moggio/protocol"
"github.com/pkg/browser"
)

Expand Down
6 changes: 3 additions & 3 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"testing"
"time"

_ "github.com/mjibson/mog/codec/mpa"
_ "github.com/mjibson/mog/codec/nsf"
_ "github.com/mjibson/mog/protocol/file"
_ "github.com/mjibson/moggio/codec/mpa"
_ "github.com/mjibson/moggio/codec/nsf"
_ "github.com/mjibson/moggio/protocol/file"
)

func TestServer(t *testing.T) {
Expand Down
Loading

0 comments on commit d2adf5c

Please sign in to comment.