Remove audio/internal.Start()

This commit is contained in:
Hajime Hoshi 2015-01-27 23:00:41 +09:00
parent ea78b31414
commit d321dfe7fd
6 changed files with 10 additions and 14 deletions

View File

@ -20,11 +20,11 @@ import (
// SampleRate returns the sampling frequency (e.g. 44100). // SampleRate returns the sampling frequency (e.g. 44100).
func SampleRate() int { func SampleRate() int {
return audio.SampleRate return internal.SampleRate
} }
// MaxChannel is a max number of channels. // MaxChannel is a max number of channels.
var MaxChannel = audio.MaxChannel var MaxChannel = internal.MaxChannel
// Play appends the given data to the given channel. // Play appends the given data to the given channel.
// //
@ -33,7 +33,7 @@ var MaxChannel = audio.MaxChannel
// //
// This function is useful to play SE or a note of PCM synthesis immediately. // This function is useful to play SE or a note of PCM synthesis immediately.
func Play(channel int, l []int16, r []int16) bool { func Play(channel int, l []int16, r []int16) bool {
return audio.Play(channel, l, r) return internal.Play(channel, l, r)
} }
// Queue queues the given data to the given channel. // Queue queues the given data to the given channel.
@ -43,10 +43,10 @@ func Play(channel int, l []int16, r []int16) bool {
// //
// This function is useful to play streaming data. // This function is useful to play streaming data.
func Queue(channel int, l []int16, r []int16) { func Queue(channel int, l []int16, r []int16) {
audio.Queue(channel, l, r) internal.Queue(channel, l, r)
} }
// IsPlaying returns a boolean value which indicates if the channel buffer has data to play. // IsPlaying returns a boolean value which indicates if the channel buffer has data to play.
func IsPlaying(channel int) bool { func IsPlaying(channel int) bool {
return audio.IsPlaying(channel) return internal.IsPlaying(channel)
} }

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package audio package internal
import ( import (
"sync" "sync"
@ -46,9 +46,6 @@ func init() {
func Init() { func Init() {
initialize() initialize()
}
func Start() {
start() start()
} }

View File

@ -14,7 +14,7 @@
// +build js // +build js
package audio package internal
import ( import (
"github.com/gopherjs/gopherjs/js" "github.com/gopherjs/gopherjs/js"

View File

@ -14,7 +14,7 @@
// +build !js // +build !js
package audio package internal
import ( import (
"bytes" "bytes"

View File

@ -15,7 +15,7 @@
package ebiten package ebiten
import ( import (
"github.com/hajimehoshi/ebiten/exp/audio/internal" audio "github.com/hajimehoshi/ebiten/exp/audio/internal"
"github.com/hajimehoshi/ebiten/internal/graphics" "github.com/hajimehoshi/ebiten/internal/graphics"
"github.com/hajimehoshi/ebiten/internal/graphics/internal/opengl" "github.com/hajimehoshi/ebiten/internal/graphics/internal/opengl"
"github.com/hajimehoshi/ebiten/internal/ui" "github.com/hajimehoshi/ebiten/internal/ui"
@ -30,7 +30,6 @@ func init() {
glContext = opengl.NewContext() glContext = opengl.NewContext()
}) })
audio.Init() audio.Init()
audio.Start()
} }
// IsKeyPressed returns a boolean indicating whether key is pressed. // IsKeyPressed returns a boolean indicating whether key is pressed.

2
run.go
View File

@ -15,7 +15,7 @@
package ebiten package ebiten
import ( import (
"github.com/hajimehoshi/ebiten/exp/audio/internal" audio "github.com/hajimehoshi/ebiten/exp/audio/internal"
"github.com/hajimehoshi/ebiten/internal/graphics/internal/opengl" "github.com/hajimehoshi/ebiten/internal/graphics/internal/opengl"
"github.com/hajimehoshi/ebiten/internal/ui" "github.com/hajimehoshi/ebiten/internal/ui"
"time" "time"