├── .gitignore ├── LICENSE ├── README.md ├── bitmaps ├── GP2X.png ├── GP2X_2.png ├── GP2X_Button.png ├── GP2X_DOWN.png ├── GP2X_LEFT.png ├── GP2X_LS.png ├── GP2X_RIGHT.png ├── GP2X_RS.png ├── GP2X_SS.png ├── GP2X_UP.png ├── GP2X_bg.png └── GP2X_overlay.png ├── docs ├── What-is-LittleGPTracker.md ├── littlegptracker.zuml ├── revision.txt └── toot │ ├── 4 │ ├── 1.txt │ ├── 2.txt │ ├── 3.txt │ ├── 5.txt │ └── scenario.txt ├── libs ├── GP2XSDL │ └── libSDL.a ├── WSDL │ ├── SDL-release.lib │ ├── SDL.lib │ ├── SDL_image.lib │ ├── SDLmain-release.lib │ └── SDLmain.lib └── Wsdl-mingw │ ├── libSDL.a │ ├── libSDL.dll.a │ └── libSDLmain.a ├── projects ├── BUILD_HOW_TO.txt ├── English.lproj │ ├── InfoPlist.strings │ └── main.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── objects.xib ├── Info.plist ├── Makefile ├── Makefile.BEAGLEBOARD ├── Makefile.CAANOO ├── Makefile.DEB ├── Makefile.DINGOO ├── Makefile.GP2X ├── Makefile.GP32 ├── Makefile.OSX ├── Makefile.PSP ├── Makefile.RASPI ├── Makefile.W32 ├── base_rules ├── beagleboard_rules ├── caanoo_rules ├── deb_rules ├── dingoo_rules ├── gp2x_rules ├── gp32_rules ├── lgpt.sln ├── lgpt.vcproj ├── lgpt.vcxproj ├── lgpt.xcodeproj │ ├── nostromo.perspective │ └── project.pbxproj ├── lgptProj.xcconfig ├── lgptTarget.xcconfig ├── lgpt_icon.bmp ├── lgptest.dev ├── nds_rules ├── osx_rules ├── piggy.icns ├── psp_bg.png ├── psp_icon.png ├── psp_rules └── raspi_rules └── sources ├── Adapters ├── CAANOO │ ├── Audio │ │ ├── CAANOOAudio.cpp │ │ ├── CAANOOAudio.h │ │ ├── CAANOOAudioDriver.cpp │ │ └── CAANOOAudioDriver.h │ ├── FileSystem │ │ ├── CAANOOFileSystem.cpp │ │ └── CAANOOFileSystem.h │ ├── Main │ │ └── CAANOOSDLMain.cpp │ ├── Midi │ │ ├── CAANOOMidiService.cpp │ │ ├── CAANOOMidiService.h │ │ ├── CAANOOSerialMidiDevice.cpp │ │ └── CAANOOSerialMidiDevice.h │ ├── System │ │ ├── CAANOOEventQueue.cpp │ │ ├── CAANOOEventQueue.h │ │ ├── CAANOOSystem.cpp │ │ ├── CAANOOSystem.h │ │ ├── gpmemcpy.s │ │ └── gpmemset.s │ └── UI │ │ ├── CAANOOGUIWindowImp.cpp │ │ ├── CAANOOGUIWindowImp.h │ │ ├── GUIFactory.cpp │ │ └── GUIFactory.h ├── DEB │ ├── Main │ │ └── DEBmain.cpp │ ├── System │ │ ├── DEBSystem.cpp │ │ └── DEBSystem.h │ └── UI │ │ ├── DEBGUIWindowImp.cpp │ │ ├── DEBGUIWindowImp.h │ │ ├── GUIFactory.cpp │ │ └── GUIFactory.h ├── DINGOO │ ├── Audio │ │ ├── DINGOOAudio.cpp │ │ ├── DINGOOAudio.h │ │ ├── DINGOOAudioDriver.cpp │ │ └── DINGOOAudioDriver.h │ ├── FileSystem │ │ ├── DINGOOFileSystem.cpp │ │ └── DINGOOFileSystem.h │ ├── Main │ │ └── GPSDLMain.cpp │ ├── Midi │ │ ├── DINGOOMidiService.cpp │ │ ├── DINGOOMidiService.h │ │ ├── DINGOOSerialMidiDevice.cpp │ │ └── DINGOOSerialMidiDevice.h │ ├── System │ │ ├── DINGOOEventQueue.cpp │ │ ├── DINGOOEventQueue.h │ │ ├── DINGOOSystem.cpp │ │ ├── DINGOOSystem.h │ │ ├── gpmemcpy.s │ │ └── gpmemset.s │ └── UI │ │ ├── DINGOOGUIWindowImp.cpp │ │ ├── DINGOOGUIWindowImp.h │ │ ├── GUIFactory.cpp │ │ └── GUIFactory.h ├── Dummy │ ├── Audio │ │ ├── DummyAudio.cpp │ │ ├── DummyAudio.h │ │ ├── DummyAudioDriver.cpp │ │ └── DummyAudioDriver.h │ ├── FileSystem │ │ ├── DummyFileSystem.cpp │ │ └── DummyFileSystem.h │ ├── Midi │ │ ├── DummyMidi.cpp │ │ └── DummyMidi.h │ └── Sound │ │ ├── DummySound.cpp │ │ └── DummySound.h ├── GP2X │ ├── Audio │ │ ├── GP2XAudio.cpp │ │ ├── GP2XAudio.h │ │ ├── GP2XAudioDriver.cpp │ │ └── GP2XAudioDriver.h │ ├── FileSystem │ │ ├── GP2XFileSystem.cpp │ │ └── GP2XFileSystem.h │ ├── Main │ │ └── GPSDLMain.cpp │ ├── Midi │ │ ├── GP2XMidiService.cpp │ │ ├── GP2XMidiService.h │ │ ├── GP2XSerialMidiDevice.cpp │ │ └── GP2XSerialMidiDevice.h │ ├── System │ │ ├── GP2XEventQueue.cpp │ │ ├── GP2XEventQueue.h │ │ ├── GP2XSystem.cpp │ │ ├── GP2XSystem.h │ │ ├── gpmemcpy.s │ │ └── gpmemset.s │ └── UI │ │ ├── GP2XGUIWindowImp.cpp │ │ ├── GP2XGUIWindowImp.h │ │ ├── GUIFactory.cpp │ │ └── GUIFactory.h ├── Jack │ ├── Audio │ │ ├── JackAudio.cpp │ │ ├── JackAudio.h │ │ ├── JackAudioDriver.cpp │ │ └── JackAudioDriver.h │ ├── Client │ │ ├── JackClient.cpp │ │ └── JackClient.h │ └── Midi │ │ ├── JackMidiDevice.cpp │ │ ├── JackMidiDevice.h │ │ ├── JackMidiService.cpp │ │ └── JackMidiService.h ├── NDS │ ├── Arm7Proc │ │ ├── Makefile │ │ └── source │ │ │ ├── arm7_main.cpp │ │ │ └── command7.cpp │ ├── Command │ │ └── command.h │ ├── FileSystem │ │ ├── NDSFileSystem.cpp │ │ └── NDSFileSystem.h │ ├── Main │ │ └── NDSmain.cpp │ ├── Sound │ │ ├── NDSSound.cpp │ │ └── NDSSound.h │ ├── System │ │ ├── NDSEventQueue.cpp │ │ ├── NDSEventQueue.h │ │ ├── NDSSystem.cpp │ │ └── NDSSystem.h │ └── UI │ │ ├── GUIFactory.cpp │ │ ├── GUIFactory.h │ │ ├── NDSGUIWindowImp.cpp │ │ └── NDSGUIWindowImp.h ├── OSX │ ├── OSXMain │ │ ├── OSXmain.cpp │ │ ├── SDLMain.h │ │ └── SDLMain.m │ └── OSXSystem │ │ ├── OSXSystem.cpp │ │ └── OSXSystem.h ├── PSP │ ├── FileSystem │ │ ├── PSPFileSystem.cpp │ │ ├── PSPFileSystem.h │ │ ├── dirlist.cpp │ │ ├── pspFileIO.cpp │ │ └── pspiofilemgr.h │ ├── Main │ │ └── PSPmain.cpp │ └── System │ │ ├── PSPSystem.cpp │ │ └── PSPSystem.h ├── RTAudio │ ├── RTAudioDriver.cpp │ ├── RTAudioDriver.h │ ├── RTAudioStub.cpp │ └── RTAudioStub.h ├── RTMidi │ ├── RTMidiInDevice.cpp │ ├── RTMidiInDevice.h │ ├── RTMidiOutDevice.cpp │ ├── RTMidiOutDevice.h │ ├── RTMidiService.cpp │ └── RTMidiService.h ├── SDL │ ├── Audio │ │ ├── SDLAudio.cpp │ │ ├── SDLAudio.h │ │ ├── SDLAudioDriver.cpp │ │ └── SDLAudioDriver.h │ ├── GUI │ │ ├── GUIFactory.cpp │ │ ├── GUIFactory.h │ │ ├── SDLEventManager.cpp │ │ ├── SDLEventManager.h │ │ ├── SDLGUIWindowImp.cpp │ │ └── SDLGUIWindowImp.h │ ├── Input │ │ ├── SDLInput.cpp │ │ └── SDLInput.h │ ├── Process │ │ ├── SDLProcess.cpp │ │ └── SDLProcess.h │ └── Timer │ │ ├── SDLTimer.cpp │ │ └── SDLTimer.h ├── Unix │ ├── FileSystem │ │ ├── UnixFileSystem.cpp │ │ └── UnixFileSystem.h │ └── Process │ │ ├── UnixProcess.cpp │ │ └── UnixProcess.h ├── W32 │ ├── Audio │ │ ├── W32Audio.cpp │ │ ├── W32Audio.h │ │ ├── W32AudioDriver.cpp │ │ └── W32AudioDriver.h │ ├── Main │ │ └── WSDLmain.cpp │ ├── Midi │ │ ├── W32MidiDevice.cpp │ │ ├── W32MidiDevice.h │ │ ├── W32MidiService.cpp │ │ └── W32MidiService.h │ ├── Process │ │ ├── W32Process.cpp │ │ └── W32Process.h │ └── Timer │ │ ├── W32Timer.cpp │ │ └── W32Timer.h ├── W32FileSystem │ ├── W32FileSystem.cpp │ └── W32FileSystem.h ├── WSDLSystem │ ├── WSDLSystem.cpp │ └── WSDLSystem.h └── WSDLUI │ ├── GUIFactory.cpp │ ├── GUIFactory.h │ ├── WSDLGUIWindowImp.cpp │ └── WSDLGUIWindowImp.h ├── Application ├── AppWindow.cpp ├── AppWindow.h ├── Application.cpp ├── Application.h ├── Audio │ ├── AudioFileStreamer.cpp │ ├── AudioFileStreamer.h │ ├── DummyAudioOut.cpp │ └── DummyAudioOut.h ├── Commands │ ├── ApplicationCommandDispatcher.cpp │ ├── ApplicationCommandDispatcher.h │ ├── CommandDispatcher.cpp │ ├── CommandDispatcher.h │ ├── EventDispatcher.cpp │ ├── EventDispatcher.h │ └── NodeList.h ├── Controllers │ ├── ControlRoom.cpp │ └── ControlRoom.h ├── Instruments │ ├── CommandList.cpp │ ├── CommandList.h │ ├── Filters.cpp │ ├── Filters.h │ ├── I_Instrument.h │ ├── I_SRPUpdater.h │ ├── InstrumentBank.cpp │ ├── InstrumentBank.h │ ├── MidiInstrument.cpp │ ├── MidiInstrument.h │ ├── SRPUpdaters.cpp │ ├── SRPUpdaters.h │ ├── SampleInstrument.cpp │ ├── SampleInstrument.h │ ├── SampleInstrumentDatas.h │ ├── SamplePool.cpp │ ├── SamplePool.h │ ├── SampleRenderingParams.h │ ├── SampleVariable.cpp │ ├── SampleVariable.h │ ├── SoundFontManager.cpp │ ├── SoundFontManager.h │ ├── SoundFontPreset.cpp │ ├── SoundFontPreset.h │ ├── SoundFontSample.cpp │ ├── SoundFontSample.h │ ├── SoundSource.cpp │ ├── SoundSource.h │ ├── WavFile.cpp │ ├── WavFile.h │ ├── WavFileWriter.cpp │ └── WavFileWriter.h ├── Mixer │ ├── MixBus.cpp │ ├── MixBus.h │ ├── MixerService.cpp │ └── MixerService.h ├── Model │ ├── Chain.cpp │ ├── Chain.h │ ├── Config.cpp │ ├── Config.h │ ├── Groove.cpp │ ├── Groove.h │ ├── Mixer.cpp │ ├── Mixer.h │ ├── Phrase.cpp │ ├── Phrase.h │ ├── Project.cpp │ ├── Project.h │ ├── Song.cpp │ ├── Song.h │ ├── Table.cpp │ └── Table.h ├── Persistency │ ├── PersistencyService.cpp │ ├── PersistencyService.h │ ├── Persistent.cpp │ └── Persistent.h ├── Player │ ├── Player.cpp │ ├── Player.h │ ├── PlayerChannel.cpp │ ├── PlayerChannel.h │ ├── PlayerMixer.cpp │ ├── PlayerMixer.h │ ├── SyncMaster.cpp │ ├── SyncMaster.h │ ├── TablePlayback.cpp │ └── TablePlayback.h ├── Utils │ ├── HexBuffers.cpp │ ├── HexBuffers.h │ ├── StringTokenizer.h │ ├── char.cpp │ ├── char.h │ ├── fixed.cpp │ ├── fixed.h │ ├── wildcard.cpp │ └── wildcard.h └── Views │ ├── BaseClasses │ ├── FieldView.cpp │ ├── FieldView.h │ ├── I_Action.cpp │ ├── I_Action.h │ ├── ModalView.cpp │ ├── ModalView.h │ ├── UIActionField.cpp │ ├── UIActionField.h │ ├── UIBigHexVarField.cpp │ ├── UIBigHexVarField.h │ ├── UIField.cpp │ ├── UIField.h │ ├── UIIntField.cpp │ ├── UIIntField.h │ ├── UIIntVarField.cpp │ ├── UIIntVarField.h │ ├── UIIntVarOffField.cpp │ ├── UIIntVarOffField.h │ ├── UINoteVarField.cpp │ ├── UINoteVarField.h │ ├── UISortedVarList.cpp │ ├── UISortedVarList.h │ ├── UIStaticField.cpp │ ├── UIStaticField.h │ ├── UITempoField.cpp │ ├── UITempoField.h │ ├── View.cpp │ ├── View.h │ ├── ViewEvent.cpp │ └── ViewEvent.h │ ├── ChainView.cpp │ ├── ChainView.h │ ├── ConsoleView.cpp │ ├── ConsoleView.h │ ├── GrooveView.cpp │ ├── GrooveView.h │ ├── InstrumentView.cpp │ ├── InstrumentView.h │ ├── ListSelectView.cpp │ ├── ListSelectView.h │ ├── MixerView.cpp │ ├── MixerView.h │ ├── ModalDialogs │ ├── ImportSampleDialog.cpp │ ├── ImportSampleDialog.h │ ├── MessageBox.cpp │ ├── MessageBox.h │ ├── NewProjectDialog.cpp │ ├── NewProjectDialog.h │ ├── SelectProjectDialog.cpp │ └── SelectProjectDialog.h │ ├── NullView.cpp │ ├── NullView.h │ ├── PhraseView.cpp │ ├── PhraseView.h │ ├── ProjectView.cpp │ ├── ProjectView.h │ ├── SongView.cpp │ ├── SongView.h │ ├── TableView.cpp │ ├── TableView.h │ ├── UIController.cpp │ ├── UIController.h │ ├── ViewData.cpp │ └── ViewData.h ├── Externals ├── Compression │ ├── lz.c │ └── lz.h ├── RTAudio │ ├── RtAudio.cpp │ ├── RtAudio.h │ ├── RtError.h │ └── include │ │ ├── asio.cpp │ │ ├── asio.h │ │ ├── asiodrivers.cpp │ │ ├── asiodrivers.h │ │ ├── asiodrvr.h │ │ ├── asiolist.cpp │ │ ├── asiolist.h │ │ ├── asiosys.h │ │ ├── dsound.h │ │ ├── ginclude.h │ │ ├── iasiodrv.h │ │ ├── iasiothiscallresolver.cpp │ │ ├── iasiothiscallresolver.h │ │ └── soundcard.h ├── RtMidi │ ├── RtError.h │ ├── RtMidi.cpp │ └── RtMidi.h ├── SDL │ ├── SDL.h │ ├── SDL_active.h │ ├── SDL_audio.h │ ├── SDL_byteorder.h │ ├── SDL_cdrom.h │ ├── SDL_config.h │ ├── SDL_config_amiga.h │ ├── SDL_config_dreamcast.h │ ├── SDL_config_macos.h │ ├── SDL_config_macosx.h │ ├── SDL_config_minimal.h │ ├── SDL_config_nds.h │ ├── SDL_config_os2.h │ ├── SDL_config_symbian.h │ ├── SDL_config_win32.h │ ├── SDL_copying.h │ ├── SDL_cpuinfo.h │ ├── SDL_endian.h │ ├── SDL_error.h │ ├── SDL_events.h │ ├── SDL_getenv.h │ ├── SDL_image.h │ ├── SDL_joystick.h │ ├── SDL_keyboard.h │ ├── SDL_keysym.h │ ├── SDL_loadso.h │ ├── SDL_main.h │ ├── SDL_mouse.h │ ├── SDL_mutex.h │ ├── SDL_name.h │ ├── SDL_opengl.h │ ├── SDL_platform.h │ ├── SDL_quit.h │ ├── SDL_rwops.h │ ├── SDL_stdinc.h │ ├── SDL_syswm.h │ ├── SDL_thread.h │ ├── SDL_timer.h │ ├── SDL_types.h │ ├── SDL_version.h │ ├── SDL_video.h │ ├── begin_code.h │ └── close_code.h ├── Soundfont │ ├── DATATYPE.H │ ├── EMUERRS.H │ ├── ENAB.CPP │ ├── ENAB.H │ ├── ENABDRV.CPP │ ├── HYDRA.CPP │ ├── HYDRA.H │ ├── OMEGA.CPP │ ├── OMEGA.H │ ├── RIFF.CPP │ ├── RIFF.H │ ├── SFDATA.H │ ├── SFDETECT.CPP │ ├── SFDETECT.H │ ├── SFENUM.H │ ├── SFLOOKUP.CPP │ ├── SFLOOKUP.H │ ├── SFNAV.CPP │ ├── SFNAV.H │ ├── SFREADER.CPP │ ├── SFREADER.H │ ├── WIN_MEM.CPP │ └── WIN_MEM.H └── TinyXML │ ├── Tiny2NosStub.cpp │ ├── Tiny2NosStub.h │ ├── tinystr.cpp │ ├── tinystr.h │ ├── tinyxml.cpp │ ├── tinyxml.h │ ├── tinyxmlerror.cpp │ └── tinyxmlparser.cpp ├── Foundation ├── I_Iterator.h ├── I_List.h ├── IteratorPtr.h ├── Observable.cpp ├── Observable.h ├── Services │ ├── Service.cpp │ ├── Service.h │ ├── ServiceRegistry.cpp │ ├── ServiceRegistry.h │ ├── SubService.cpp │ └── SubService.h ├── SingletonRegistry.cpp ├── SingletonRegistry.h ├── T_Factory.cpp ├── T_Factory.h ├── T_SimpleList.cpp ├── T_SimpleList.h ├── T_SimpleListIterator.cpp ├── T_SimpleListIterator.h ├── T_Singleton.cpp ├── T_Singleton.h ├── T_Stack.cpp ├── T_Stack.h ├── Types │ └── Types.h └── Variables │ ├── Variable.cpp │ ├── Variable.h │ ├── VariableContainer.cpp │ ├── VariableContainer.h │ ├── WatchedVariable.cpp │ └── WatchedVariable.h ├── Resources ├── icon1.ico ├── lgpt.rc ├── lgpt_icon.bmp └── resource.h ├── Services ├── Audio │ ├── Audio.cpp │ ├── Audio.h │ ├── AudioDriver.cpp │ ├── AudioDriver.h │ ├── AudioMixer.cpp │ ├── AudioMixer.h │ ├── AudioModule.h │ ├── AudioOut.cpp │ ├── AudioOut.h │ ├── AudioOutDriver.cpp │ ├── AudioOutDriver.h │ └── AudioSettings.h ├── Controllers │ ├── ButtonControllerSource.cpp │ ├── ButtonControllerSource.h │ ├── Channel.cpp │ ├── Channel.h │ ├── ControlNode.cpp │ ├── ControlNode.h │ ├── ControllableVariable.cpp │ ├── ControllableVariable.h │ ├── ControllerService.cpp │ ├── ControllerService.h │ ├── ControllerSource.cpp │ ├── ControllerSource.h │ ├── HatControllerSource.cpp │ ├── HatControllerSource.h │ ├── JoystickControllerSource.cpp │ ├── JoystickControllerSource.h │ ├── KeyboardControllerSource.cpp │ ├── KeyboardControllerSource.h │ ├── MultiChannelAdapter.cpp │ └── MultiChannelAdapter.h ├── Midi │ ├── MidiChannel.cpp │ ├── MidiChannel.h │ ├── MidiEvent.cpp │ ├── MidiEvent.h │ ├── MidiInDevice.cpp │ ├── MidiInDevice.h │ ├── MidiInMerger.cpp │ ├── MidiInMerger.h │ ├── MidiMessage.h │ ├── MidiOutDevice.cpp │ ├── MidiOutDevice.h │ ├── MidiService.cpp │ └── MidiService.h └── Time │ ├── TimeService.cpp │ └── TimeService.h ├── System ├── Console │ ├── Logger.cpp │ ├── Logger.h │ ├── Trace.cpp │ ├── Trace.h │ ├── n_assert.cpp │ └── n_assert.h ├── Errors │ ├── Result.cpp │ └── Result.h ├── FileSystem │ ├── FileSystem.cpp │ └── FileSystem.h ├── Memory │ ├── LeakManager.cpp │ └── LeakManager.h ├── Process │ ├── Process.cpp │ ├── Process.h │ ├── SysMutex.cpp │ └── SysMutex.h ├── System │ ├── System.h │ └── typedefs.h ├── Timer │ ├── Timer.cpp │ └── Timer.h ├── _Midi │ ├── Midi.cpp │ └── Midi.h └── io │ ├── Status.cpp │ └── Status.h └── UIFramework ├── BasicDatas ├── GUIBitmap.cpp ├── GUIBitmap.h ├── GUICreateWindowParams.h ├── GUIEvent.cpp ├── GUIEvent.h ├── GUIPoint.h ├── GUIRect.cpp └── GUIRect.h ├── Framework ├── GUIColor.h ├── GUIParentGraphics.cpp ├── GUIParentGraphics.h └── GUITextProperties.h ├── Interfaces ├── I_GUIGraphics.h ├── I_GUIWindowFactory.h ├── I_GUIWindowImp.cpp └── I_GUIWindowImp.h └── SimpleBaseClasses ├── EventManager.cpp ├── EventManager.h ├── GUIWindow.cpp └── GUIWindow.h /.gitignore: -------------------------------------------------------------------------------- 1 | bin/** 2 | build/** 3 | projects/buildPSP/** 4 | tracks/** -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LittleGPTracker 2 | 3 | LittleGPTracker (a.k.a 'The piggy') is a music tracker optimised to run on portable game consoles. 4 | -------------------------------------------------------------------------------- /bitmaps/GP2X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X.png -------------------------------------------------------------------------------- /bitmaps/GP2X_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_2.png -------------------------------------------------------------------------------- /bitmaps/GP2X_Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_Button.png -------------------------------------------------------------------------------- /bitmaps/GP2X_DOWN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_DOWN.png -------------------------------------------------------------------------------- /bitmaps/GP2X_LEFT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_LEFT.png -------------------------------------------------------------------------------- /bitmaps/GP2X_LS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_LS.png -------------------------------------------------------------------------------- /bitmaps/GP2X_RIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_RIGHT.png -------------------------------------------------------------------------------- /bitmaps/GP2X_RS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_RS.png -------------------------------------------------------------------------------- /bitmaps/GP2X_SS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_SS.png -------------------------------------------------------------------------------- /bitmaps/GP2X_UP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_UP.png -------------------------------------------------------------------------------- /bitmaps/GP2X_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_bg.png -------------------------------------------------------------------------------- /bitmaps/GP2X_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/bitmaps/GP2X_overlay.png -------------------------------------------------------------------------------- /docs/littlegptracker.zuml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/docs/littlegptracker.zuml -------------------------------------------------------------------------------- /docs/revision.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/docs/revision.txt -------------------------------------------------------------------------------- /libs/GP2XSDL/libSDL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/GP2XSDL/libSDL.a -------------------------------------------------------------------------------- /libs/WSDL/SDL-release.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/WSDL/SDL-release.lib -------------------------------------------------------------------------------- /libs/WSDL/SDL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/WSDL/SDL.lib -------------------------------------------------------------------------------- /libs/WSDL/SDL_image.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/WSDL/SDL_image.lib -------------------------------------------------------------------------------- /libs/WSDL/SDLmain-release.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/WSDL/SDLmain-release.lib -------------------------------------------------------------------------------- /libs/WSDL/SDLmain.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/WSDL/SDLmain.lib -------------------------------------------------------------------------------- /libs/Wsdl-mingw/libSDL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/Wsdl-mingw/libSDL.a -------------------------------------------------------------------------------- /libs/Wsdl-mingw/libSDL.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/Wsdl-mingw/libSDL.dll.a -------------------------------------------------------------------------------- /libs/Wsdl-mingw/libSDLmain.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/libs/Wsdl-mingw/libSDLmain.a -------------------------------------------------------------------------------- /projects/BUILD_HOW_TO.txt: -------------------------------------------------------------------------------- 1 | Windows: Use Visual 2008 express edition + will need the DirectX SDK (I'm using March 2008) 2 | 3 | Mac: Use Xcode 3.x + will need the SDL Framework installed 4 | 5 | CAANOO: Compile under linux with the caanoo toolchain 6 | 7 | GP2X: Compile under minsys 8 | 9 | PSP: Compile under minsys 10 | 11 | DINGOO: Compile under Linux 12 | -------------------------------------------------------------------------------- /projects/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/projects/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /projects/English.lproj/main.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = (); 3 | IBVersion = 1; 4 | } 5 | -------------------------------------------------------------------------------- /projects/English.lproj/main.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 117 12 356 240 0 0 1920 1178 7 | IBEditorPositions 8 | 9 | 29 10 | 110 302 204 44 0 0 1920 1178 11 | 12 | IBFramework Version 13 | 431.0 14 | IBOldestOS 15 | 3 16 | IBOpenObjects 17 | 18 | 29 19 | 166 20 | 21 | IBSystem Version 22 | 8A383 23 | targetFramework 24 | IBCarbonFramework 25 | 26 | 27 | -------------------------------------------------------------------------------- /projects/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | piggy 11 | CFBundleIdentifier 12 | com.yourcompany.lgpt 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | CSResourcesFileMapped 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /projects/Makefile.BEAGLEBOARD: -------------------------------------------------------------------------------- 1 | DEVKIT=/usr/local/angstrom/arm 2 | 3 | TOOLPATH=$(DEVKIT)/bin 4 | PREFIX := arm-angstrom-linux-gnueabi- 5 | 6 | include $(PWD)/beagleboard_rules 7 | 8 | SDLBASE:= /home/nostromo/devtree/syntharchitecture/Libs/Beagleboard/SDL/ 9 | CFLAGS := -I$(SDLBASE)/include -DDEBUG -O3 -Wall -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources -D__LINUX_ALSA__ -DCPP_MEMORY -D_NO_JACK_ 10 | 11 | CXXFLAGS:= $(CFLAGS) 12 | 13 | EXTENSION:= beagle-exe 14 | 15 | LIBS := -L$(SDLBASE)/lib -L/opt/mipsel-linux-uclibc/usr/lib -lSDL -ldirectfb -lasound -lpthread -ldl -lts 16 | LIBDIRS := $(DEKVIT)/usr/lib 17 | -------------------------------------------------------------------------------- /projects/Makefile.CAANOO: -------------------------------------------------------------------------------- 1 | 2 | DEVKITARM=/home/nostromo/caanoodev/gcc-4.2.4-glibc-2.7-eabi/ 3 | 4 | PREFIX := arm-gph-linux-gnueabi- 5 | 6 | include $(PWD)/caanoo_rules 7 | 8 | CFLAGS := -O3 -DNDEBUG -Wall -DCPP_MEMORY -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources -D__LINUX_OSS__ 9 | #CFLAGS := -g -D_DEBUG -Wall -DCPP_MEMORY -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources -D__LINUX_OSS__ 10 | 11 | CXXFLAGS:= $(CFLAGS) 12 | 13 | EXTENSION:= gpe 14 | 15 | LIBS := -L/c/GPH_SDK/tools/cross-eabi/arm-gph-linux-gnueabi/sys-root/ -L/c/GPH_SDK/tools/cross-eabi/arm-gph-linux-gnueabi/sys-root/lib -L/c/GPH_SDK/tools/cross-eabi/arm-gph-linux-gnueabi/sys-root/usr/lib -lSDL 16 | #-lpthread 17 | 18 | 19 | LIBDIRS := $(DEKVITARM)/lib 20 | -------------------------------------------------------------------------------- /projects/Makefile.DEB: -------------------------------------------------------------------------------- 1 | 2 | include $(PWD)/deb_rules 3 | 4 | CFLAGS := -O3 -DCPP_MEMORY -Wall -I/usr/local/include -I$(PWD)/../sources -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ -D_DEBUG 5 | #CFLAGS := -g -DCPP_MEMORY -Wall -I/usr/local/include -I$(PWD)/../sources -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ 6 | 7 | 8 | CXXFLAGS:= $(CFLAGS) 9 | 10 | EXTENSION:= deb-exe 11 | 12 | LIBS := -O3 -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread 13 | #LIBS := -g -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread 14 | 15 | -------------------------------------------------------------------------------- /projects/Makefile.DINGOO: -------------------------------------------------------------------------------- 1 | 2 | DEVKIT=/opt/mipsel-linux-uclibc 3 | 4 | TOOLPATH=$(DEVKIT)/usr/bin 5 | PREFIX := mipsel-linux- 6 | SDL_BASE = /opt/mipsel-linux-uclibc/usr/bin/ 7 | 8 | include $(PWD)/dingoo_rules 9 | 10 | CFLAGS := `$(SDL_BASE)sdl-config --cflags` -O3 -D_DEBUG -Wall -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources -D__LINUX_ALSA__ -DCPP_MEMORY 11 | 12 | CXXFLAGS:= $(CFLAGS) 13 | 14 | EXTENSION:= dge 15 | 16 | LIBS := -L/opt/mipsel-linux-uclibc/usr/lib -lSDL -lpthread 17 | LIBDIRS := $(DEKVIT)/usr/lib 18 | -------------------------------------------------------------------------------- /projects/Makefile.GP2X: -------------------------------------------------------------------------------- 1 | 2 | DEVKITARM=/c/devkitGP2X 3 | 4 | DEVKITPRO=$(DEVKITARM)/.. 5 | 6 | TOOLPATH=$(DEVKITARM)/bin 7 | PREFIX := arm-linux- 8 | SDL_BASE = C:/devkitGP2X/bin/arm-linux- 9 | 10 | include $(PWD)/gp2x_rules 11 | 12 | CFLAGS := `$(SDL_BASE)sdl-config --cflags` -DNDEBUG -O2 -Wall -DCPP_MEMORY -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources -D__LINUX_OSS__ 13 | 14 | CXXFLAGS:= $(CFLAGS) 15 | 16 | EXTENSION:= gpe 17 | 18 | LIBS := -L$(PWD)/../libs/GP2XSDL/ -lSDL -lpthread 19 | 20 | 21 | LIBDIRS := $(DEKVITPRO)/lib 22 | -------------------------------------------------------------------------------- /projects/Makefile.GP32: -------------------------------------------------------------------------------- 1 | 2 | DEVKITARM=/c/devkitGP32/devkitarm 3 | 4 | DEVKITPRO=$(DEVKITARM)/.. 5 | 6 | TOOLPATH=$(DEVKITARM)/bin 7 | PREFIX := arm-linux- 8 | 9 | include $(PWD)/gp32_rules 10 | 11 | CFLAGS := -Wall -O2 -mtune=arm9tdmi\ 12 | -fomit-frame-pointer\ 13 | -ffast-math $(INCLUDE)\ 14 | -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources 15 | 16 | CXXFLAGS:= -fexceptions $(CFLAGS) 17 | 18 | EXTENSION:= fxe 19 | 20 | LIBS := -lmirkoSDK -laddon -lm 21 | 22 | LIBDIRS := $(LIBMIRKO) 23 | -------------------------------------------------------------------------------- /projects/Makefile.OSX: -------------------------------------------------------------------------------- 1 | 2 | include $(PWD)/osx_rules 3 | 4 | CFLAGS := -O3 -Wall -I$(PWD) -I/Library/Frameworks/SDL.framework/Headers 5 | 6 | CXXFLAGS:= $(CFLAGS) 7 | 8 | EXTENSION:= app 9 | 10 | LIBS := 11 | 12 | -------------------------------------------------------------------------------- /projects/Makefile.PSP: -------------------------------------------------------------------------------- 1 | 2 | PATH=$PATH:/c/devkitpro/devkitPSP/bin 3 | 4 | TARGET = lgpt 5 | 6 | EXTRA_TARGETS = EBOOT.PBP 7 | PSP_EBOOT_TITLE = LittleGPTracker 8 | PSP_EBOOT_ICON = $(PWD)/psp_icon.png 9 | PSP_EBOOT_PIC1 = $(PWD)/psp_bg.png 10 | 11 | include $(PWD)/psp_rules 12 | 13 | PSPSDK=$(shell /c/devkitpro/devkitPSP/bin/psp-config --pspsdk-path) 14 | PSPBIN = $(PSPSDK)/../bin 15 | 16 | CFLAGS := -O3 -G0 -Wall -DPLATFORM_$(PLATFORM) -DNDEBUG -DCPP_MEMORY -I$(PWD)/../sources -I$(PSPSDK)/include 17 | 18 | CXXFLAGS:= $(CFLAGS) -fexceptions -fno-rtti 19 | 20 | EXTENSION:= elf 21 | 22 | LIBS = -L/usr/local/pspsdk/lib -lSDL_image -lpng -lz -lstdc++ 23 | LIBS += -lSDL -lGL -lglu -lglut -lpspvfpu -lm -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -ljpeg 24 | 25 | -------------------------------------------------------------------------------- /projects/Makefile.RASPI: -------------------------------------------------------------------------------- 1 | 2 | include $(PWD)/raspi_rules 3 | 4 | CFLAGS := -O3 -DCPP_MEMORY -Wall -I/usr/local/include -I$(PWD)/../sources -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ -D_NO_JACK_ -D_NDEBUG 5 | #CFLAGS := -g -DCPP_MEMORY -Wall -I/usr/local/include -I$(PWD)/../sources -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ -D_NO_JACK_ 6 | 7 | 8 | CXXFLAGS:= $(CFLAGS) 9 | 10 | EXTENSION:= rpi-exe 11 | 12 | LIBS := -lasound -lSDL -lpthread 13 | 14 | -------------------------------------------------------------------------------- /projects/Makefile.W32: -------------------------------------------------------------------------------- 1 | 2 | WTOOLPATH=c:/MinGW/bin 3 | 4 | PREFIX := 5 | 6 | include $(PWD)/base_rules 7 | 8 | CFLAGS := -mthreads -g -Wall $(INCLUDES) -D_DEBUG -DDEBUG -DPLATFORM_$(PLATFORM) -I$(PWD)/../sources 9 | 10 | CXXFLAGS:= $(CFLAGS) 11 | LDFLAGS := -L../../libs/Wsdl-mingw 12 | LIBS := -lmingw32 -lSDLmain -lSDL -mwindows -luser32 -lgdi32 -lwinmm -ldxguid 13 | 14 | EXTENSION:= exe 15 | -------------------------------------------------------------------------------- /projects/beagleboard_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | #--------------------------------------------------------------------------------- 4 | %.beagle-exe: $(OFILES) 5 | $(CXX) $(LDFLAGS) $@ $(OFILES) $(LIBS) 6 | 7 | -------------------------------------------------------------------------------- /projects/caanoo_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | STRIP = arm-gph-linux-gnueabi-strip 4 | 5 | #--------------------------------------------------------------------------------- 6 | %.gpe: $(OFILES) 7 | $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) 8 | @$(STRIP) $@ 9 | -------------------------------------------------------------------------------- /projects/deb_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | #--------------------------------------------------------------------------------- 4 | %.deb-exe: $(OFILES) 5 | $(CXX) $(LDFLAGS) $@ $(OFILES) $(LIBS) 6 | 7 | -------------------------------------------------------------------------------- /projects/dingoo_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | #STRIP = mipsel-linux-strip 4 | STRIP = ls 5 | 6 | #--------------------------------------------------------------------------------- 7 | %.dge: $(OFILES) 8 | $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) 9 | @$(STRIP) $@ 10 | -------------------------------------------------------------------------------- /projects/gp2x_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | STRIP = arm-linux-strip 4 | 5 | #--------------------------------------------------------------------------------- 6 | %.gpe: $(OFILES) 7 | $(CXX) -static $(LDFLAGS) -o $@ $(OFILES) $(LIBS) 8 | @$(STRIP) $@ 9 | -------------------------------------------------------------------------------- /projects/gp32_rules: -------------------------------------------------------------------------------- 1 | -include $(DEVKITARM)/base_rules 2 | 3 | LIBMIRKO := $(DEVKITPRO)/libmirko 4 | 5 | #--------------------------------------------------------------------------------- 6 | %.fxe: %.bin 7 | b2fxec -a "$(AUTHOR)" -t "$(NAME)" -b "$(PWD)/$(ICON)" $< $@ 8 | @echo built ... $(notdir $@) 9 | 10 | #--------------------------------------------------------------------------------- 11 | %.bin: %.elf 12 | @$(OBJCOPY) -O binary $< $@ 13 | @echo built ... $(notdir $@) 14 | 15 | #--------------------------------------------------------------------------------- 16 | %.elf: 17 | @echo linking binary 18 | @$(LD) $(LDFLAGS) -specs=gp32.specs $(OFILES) $(LIBPATHS) $(LIBS) -o $@ 19 | -------------------------------------------------------------------------------- /projects/lgptProj.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_ENABLE_CPP_EXCEPTIONS = YES; 2 | GCC_ENABLE_CPP_RTTI = YES; 3 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 4 | GCC_WARN_UNUSED_VARIABLE = YES; 5 | SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 6 | GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES; 7 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 8 | PREBINDING = NO; 9 | INFOPLIST_EXPAND_BUILD_SETTINGS = YES; -------------------------------------------------------------------------------- /projects/lgptTarget.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 2 | GCC_PREFIX_HEADER = lgpt_Prefix.pch; 3 | INFOPLIST_FILE = Info.plist; 4 | INSTALL_PATH = $(HOME)/Applications; 5 | PRODUCT_NAME = lgpt $(CONFIGURATION); 6 | STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = Dynamic; 7 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 8 | -------------------------------------------------------------------------------- /projects/lgpt_icon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/projects/lgpt_icon.bmp -------------------------------------------------------------------------------- /projects/osx_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | #--------------------------------------------------------------------------------- 4 | %.app: $(OFILES) 5 | $(CXX) $(LDFLAGS) -arch i386 -framework SDL -framework Cocoa -framework Carbon -o $@ $(OFILES) $(LIBS) 6 | mv $@ ../lgpt 7 | -------------------------------------------------------------------------------- /projects/piggy.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/projects/piggy.icns -------------------------------------------------------------------------------- /projects/psp_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/projects/psp_bg.png -------------------------------------------------------------------------------- /projects/psp_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/projects/psp_icon.png -------------------------------------------------------------------------------- /projects/psp_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | TARGET=lgpt 4 | 5 | export OBJS:=$(OFILES) -------------------------------------------------------------------------------- /projects/raspi_rules: -------------------------------------------------------------------------------- 1 | -include $(PWD)/base_rules 2 | 3 | #--------------------------------------------------------------------------------- 4 | %.rpi-exe: $(OFILES) 5 | $(CXX) -o $(LDFLAGS) $@ $(OFILES) $(LIBS) 6 | 7 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/Audio/CAANOOAudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAANOOAUDIO_H_ 2 | #define _CAANOOAUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | 6 | class CAANOOAudio: public Audio { 7 | public: 8 | CAANOOAudio(AudioSettings &settings) ; 9 | ~CAANOOAudio() ; 10 | virtual void Init() ; 11 | virtual void Close() ; 12 | virtual int GetMixerVolume() ; 13 | virtual void SetMixerVolume(int volume) ; 14 | }; 15 | #endif 16 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAANOO_SOUND_H_ 2 | #define _CAANOO_SOUND_H_ 3 | 4 | #include "Services/Audio/AudioDriver.h" 5 | 6 | 7 | class CAANOOAudioDriver:public AudioDriver { 8 | public: 9 | CAANOOAudioDriver(AudioSettings &settings) ; 10 | virtual ~CAANOOAudioDriver() ; 11 | 12 | // Sound implementation 13 | virtual bool InitDriver() ; 14 | virtual void CloseDriver(); 15 | virtual bool StartDriver() ; 16 | virtual void StopDriver(); 17 | virtual int GetPlayedBufferPercentage() ; 18 | virtual int GetSampleRate() { return 44100 ; } ; 19 | virtual bool Interlaced() { return true ; } ; 20 | // Additional 21 | void OnChunkDone() ; 22 | void SetVolume(int v) ; 23 | int GetVolume() ; 24 | void NewBuffer() ; 25 | virtual double GetStreamTime() ; 26 | private: 27 | AudioSettings settings_ ; 28 | int fragSize_ ; 29 | char *unalignedMain_ ; 30 | char *mainBuffer_ ; 31 | char *miniBlank_ ; 32 | int bufferPos_ ; 33 | int bufferSize_ ; 34 | int volume_ ; 35 | int ticksBeforeMidi_ ; 36 | unsigned long streamSampleTime_ ; 37 | } ; 38 | #endif 39 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CAANOO_FILESYSTEM_H_ 3 | #define _CAANOO_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | 8 | class CAANOOFile: public I_File { 9 | public: 10 | CAANOOFile(FILE *) ; 11 | virtual int Read(void *ptr, int size, int nmemb) ; 12 | virtual int Write(const void *ptr, int size, int nmemb) ; 13 | virtual void Printf(const char *format,...); 14 | virtual void Seek(long offset,int whence) ; 15 | virtual long Tell() ; 16 | 17 | virtual void Close() ; 18 | private: 19 | FILE *file_ ; 20 | } ; 21 | 22 | class CAANOODir: public I_Dir { 23 | public: 24 | CAANOODir(const char *path) ; 25 | virtual ~CAANOODir() {} ; 26 | virtual void GetContent(char *mask) ; 27 | } ; 28 | 29 | class CAANOOFileSystem: public FileSystem { 30 | public: 31 | virtual I_File *Open(const char *path,char *mode); 32 | virtual I_Dir *Open(const char *path) ; 33 | virtual FileType GetFileType(const char *path) ; 34 | virtual void MakeDir(const char *path) ; 35 | virtual void Delete(const char *path) ; 36 | } ; 37 | #endif 38 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp: -------------------------------------------------------------------------------- 1 | // VC6GUI.cpp : Defines the entry point for the application. 2 | // 3 | 4 | #include "Application/Application.h" 5 | #include "Adapters/CAANOO/System/CAANOOSystem.h" 6 | #include 7 | #include 8 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 9 | #include "Application/Persistency/PersistencyService.h" 10 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 11 | 12 | int main(int argc,char *argv[]) 13 | { 14 | GPSDLSystem::Boot(argc,argv) ; 15 | 16 | SDLCreateWindowParams params ; 17 | params.title="littlegptracker" ; 18 | params.cacheFonts_=true ; 19 | params.framebuffer_=true ; 20 | 21 | Application::GetInstance()->Init(params) ; 22 | 23 | GPSDLSystem::MainLoop() ; 24 | GPSDLSystem::Shutdown() ; 25 | return 0 ; 26 | } 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/Midi/CAANOOMidiService.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CAANOOMidiService.h" 3 | #include "CAANOOSerialMidiDevice.h" 4 | 5 | CAANOOMidiService::CAANOOMidiService() { 6 | } ; 7 | 8 | CAANOOMidiService::~CAANOOMidiService() { 9 | } ; 10 | 11 | void CAANOOMidiService::buildDriverList() {// Here we just loop over existing Midi out and create a midi device for each of them. 12 | 13 | Insert(new CAANOOSerialMidiDevice()) ; 14 | 15 | } ; 16 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/Midi/CAANOOMidiService.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CAANOO_MIDI_SERVICE_H_ 3 | #define _CAANOO_MIDI_SERVICE_H_ 4 | 5 | #include "Services/Midi/MidiService.h" 6 | 7 | class CAANOOMidiService: public MidiService { 8 | public: 9 | CAANOOMidiService() ; 10 | ~CAANOOMidiService() ; 11 | protected: 12 | virtual void buildDriverList() ; 13 | 14 | } ; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAANOO_SERIAL_MIDI_DEVICE_H_ 2 | #define _CAANOO_SERIAL_MIDI_DEVICE_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | 6 | #include 7 | 8 | class CAANOOSerialMidiDevice: public MidiOutDevice { 9 | public: 10 | CAANOOSerialMidiDevice() ; 11 | virtual bool Init() ; 12 | virtual void Close() ; 13 | virtual bool Start() ; 14 | virtual void Stop(); 15 | 16 | protected: 17 | virtual void SendMessage(MidiMessage &) ; 18 | private: 19 | struct termios oldtio_; 20 | int fd_ ; 21 | const char *port_; 22 | 23 | } ; 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/System/CAANOOEventQueue.cpp: -------------------------------------------------------------------------------- 1 | #include "CAANOOEventQueue.h" 2 | 3 | CAANOOEventQueue::CAANOOEventQueue(): 4 | T_Stack(true) { 5 | } 6 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/System/CAANOOEventQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAANOO_EVENT_QUEUE_H_ 2 | #define _CAANOO_EVENT_QUEUE_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "Foundation/T_Stack.h" 6 | 7 | enum CAANOOEventType { 8 | CAANOOET_REDRAW 9 | } ; 10 | 11 | class CAANOOEvent { 12 | public: 13 | CAANOOEventType type_; 14 | } ; 15 | 16 | class CAANOOEventQueue: public T_Singleton,public T_Stack { 17 | public: 18 | CAANOOEventQueue() ; 19 | } ; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/System/CAANOOSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPSDL_SYSTEM_H_ 2 | #define _GPSDL_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 6 | #include 7 | 8 | #define USEREVENT_TIMER 0 9 | #define USEREVENT_EXPOSE 1 10 | 11 | class GPSDLSystem: public System { 12 | public: 13 | static void Boot(int argc,char **argv) ; 14 | static void Shutdown() ; 15 | static int MainLoop() ; 16 | 17 | public: // System implementation 18 | virtual unsigned long GetClock() ; 19 | virtual int GetBatteryLevel() ; 20 | virtual void Sleep(int millisec); 21 | virtual void *Malloc(unsigned size) ; 22 | virtual void Free(void *) ; 23 | virtual void Memset(void *addr,char val,int size) ; 24 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 25 | virtual void PostQuitMessage() ; 26 | virtual unsigned int GetMemoryUsage() ; 27 | 28 | private: 29 | static bool invert_ ; 30 | static int lastBattLevel_ ; 31 | static unsigned int lastBeatCount_ ; 32 | static EventManager *eventManager_; 33 | } ; 34 | #endif 35 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/UI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "CAANOOGUIWindowImp.h" 3 | 4 | 5 | GUIFactory::GUIFactory() { 6 | } ; 7 | 8 | 9 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 10 | return *(new CAANOOGUIWindowImp(p)) ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Adapters/CAANOO/UI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef CAANOO_GUI_FACTORY_H_ 2 | #define CAANOO_GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory: public I_GUIWindowFactory { 7 | 8 | 9 | 10 | public: 11 | 12 | GUIFactory() ; 13 | 14 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 15 | 16 | } ; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/DEB/Main/DEBmain.cpp: -------------------------------------------------------------------------------- 1 | #include "Application/Application.h" 2 | #include "Adapters/DEB/System/DEBSystem.h" 3 | #include 4 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 5 | 6 | int main(int argc,char *argv[]) 7 | { 8 | DEBSystem::Boot(argc,argv) ; 9 | 10 | SDLCreateWindowParams params ; 11 | params.title="littlegptracker" ; 12 | params.cacheFonts_=true ; 13 | 14 | Application::GetInstance()->Init(params) ; 15 | 16 | int retval=DEBSystem::MainLoop() ; 17 | 18 | return retval ; 19 | } 20 | 21 | 22 | 23 | void _assert() { 24 | } ; 25 | -------------------------------------------------------------------------------- /sources/Adapters/DEB/System/DEBSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEB_SYSTEM_H_ 2 | #define _DEB_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 6 | #include 7 | 8 | class DEBSystem: public System { 9 | public: 10 | static void Boot(int argc,char **argv) ; 11 | static void Shutdown() ; 12 | static int MainLoop() ; 13 | 14 | public: // System implementation 15 | virtual unsigned long GetClock() ; 16 | virtual void Sleep(int millisec); 17 | virtual void *Malloc(unsigned size) ; 18 | virtual void Free(void *) ; 19 | virtual void Memset(void *addr,char val,int size) ; 20 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 21 | virtual void AddUserLog(const char *) ; 22 | virtual int GetBatteryLevel() { return -1 ; } ; 23 | virtual void PostQuitMessage() ; 24 | virtual unsigned int GetMemoryUsage() ; 25 | 26 | protected: // Additional 27 | static unsigned short getButtonMask(SDL_Event&) ; 28 | static void readConfig() ; 29 | static void checkKey(int ,const char *,const char *[]); 30 | private: 31 | static int keyRepeat_ ; 32 | static int keyDelay_ ; 33 | static bool finished_ ; 34 | static EventManager *eventManager_; 35 | } ; 36 | #endif 37 | -------------------------------------------------------------------------------- /sources/Adapters/DEB/UI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "DEBGUIWindowImp.h" 3 | 4 | 5 | GUIFactory::GUIFactory() { 6 | } ; 7 | 8 | 9 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 10 | return *(new DEBGUIWindowImp(p)) ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Adapters/DEB/UI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_GUI_FACTORY_H_ 2 | #define WIN32_GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory: public I_GUIWindowFactory { 7 | 8 | 9 | 10 | public: 11 | 12 | GUIFactory() ; 13 | 14 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 15 | 16 | } ; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Audio/DINGOOAudio.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DINGOOAudio.h" 3 | #include "DINGOOAudioDriver.h" 4 | #include "Services/Audio/AudioOutDriver.h" 5 | 6 | DINGOOAudio::DINGOOAudio(AudioSettings &hints):Audio(hints) 7 | { 8 | hints_=hints; 9 | } 10 | 11 | DINGOOAudio::~DINGOOAudio() 12 | { 13 | } 14 | 15 | void DINGOOAudio::Init() 16 | { 17 | drv=new DINGOOAudioDriver(hints_) ; 18 | AudioOut *out=new AudioOutDriver(*drv) ; 19 | Insert(out) ; 20 | } 21 | 22 | void DINGOOAudio::Close() 23 | { 24 | IteratorPtrit(GetIterator()) ; 25 | for (it->Begin();!it->IsDone();it->Next()) 26 | { 27 | AudioOut ¤t=it->CurrentItem() ; 28 | current.Close() ; 29 | } 30 | } 31 | 32 | int DINGOOAudio::GetMixerVolume() 33 | { 34 | return drv->GetVolume(); 35 | } 36 | 37 | void DINGOOAudio::SetMixerVolume(int volume) 38 | { 39 | drv->SetVolume(volume); 40 | } 41 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Audio/DINGOOAudio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Services/Audio/Audio.h" 4 | #include "DINGOOAudioDriver.h" 5 | 6 | class DINGOOAudio: public Audio 7 | { 8 | public: 9 | DINGOOAudio(AudioSettings &hints) ; // Allow for different default size for different platform 10 | ~DINGOOAudio() ; 11 | virtual void Init() ; 12 | virtual void Close() ; 13 | virtual int GetMixerVolume() ; 14 | virtual void SetMixerVolume(int volume) ; 15 | private: 16 | DINGOOAudioDriver *drv; 17 | AudioSettings hints_ ; 18 | }; 19 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Services/Audio/AudioDriver.h" 4 | #include "Adapters/SDL/Audio/SDLAudioDriver.h" 5 | 6 | class DINGOOAudioDriver:public SDLAudioDriver 7 | { 8 | public: 9 | DINGOOAudioDriver(AudioSettings &settings) ; 10 | virtual ~DINGOOAudioDriver() ; 11 | 12 | virtual bool InitDriver() ; 13 | virtual void CloseDriver(); 14 | 15 | void SetVolume(int vol); 16 | int GetVolume(); 17 | 18 | private: 19 | int volume_; 20 | long mixer_; 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DINGOO_FILESYSTEM_H_ 3 | #define _DINGOO_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | 8 | class DINGOOFile: public I_File { 9 | public: 10 | DINGOOFile(FILE *) ; 11 | virtual int Read(void *ptr, int size, int nmemb) ; 12 | virtual int Write(const void *ptr, int size, int nmemb) ; 13 | virtual void Printf(const char *format,...); 14 | virtual void Seek(long offset,int whence) ; 15 | virtual long Tell() ; 16 | 17 | virtual void Close() ; 18 | private: 19 | FILE *file_ ; 20 | } ; 21 | 22 | class DINGOODir: public I_Dir { 23 | public: 24 | DINGOODir(const char *path) ; 25 | virtual ~DINGOODir() {} ; 26 | virtual void GetContent(char *mask) ; 27 | } ; 28 | 29 | class DINGOOFileSystem: public FileSystem { 30 | public: 31 | virtual I_File *Open(const char *path,char *mode); 32 | virtual I_Dir *Open(const char *path) ; 33 | virtual FileType GetFileType(const char *path) ; 34 | virtual void MakeDir(const char *path) ; 35 | virtual void Delete(const char *path) ; 36 | } ; 37 | #endif 38 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Main/GPSDLMain.cpp: -------------------------------------------------------------------------------- 1 | #include "Application/Application.h" 2 | #include "Adapters/DINGOO/System/DINGOOSystem.h" 3 | #include "Foundation/T_Singleton.h" 4 | #include 5 | #include 6 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 7 | #include "Application/Persistency/PersistencyService.h" 8 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 9 | 10 | int main(int argc,char *argv[]) 11 | { 12 | GPSDLSystem::Boot(argc,argv) ; 13 | 14 | SDLCreateWindowParams params ; 15 | params.title="littlegptracker" ; 16 | params.cacheFonts_=true ; 17 | params.framebuffer_=true ; 18 | 19 | Application::GetInstance()->Init(params) ; 20 | 21 | GPSDLSystem::MainLoop() ; 22 | GPSDLSystem::Shutdown() ; 23 | } 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Midi/DINGOOMidiService.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DINGOOMidiService.h" 3 | #include "DINGOOSerialMidiDevice.h" 4 | #include "System/io/Trace.h" 5 | 6 | DINGOOMidiService::DINGOOMidiService() { 7 | } ; 8 | 9 | DINGOOMidiService::~DINGOOMidiService() { 10 | } ; 11 | 12 | void DINGOOMidiService::buildDriverList() {// Here we just loop over existing Midi out and create a midi device for each of them. 13 | 14 | Insert(new DINGOOSerialMidiDevice()) ; 15 | 16 | } ; 17 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Midi/DINGOOMidiService.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DINGOO_MIDI_SERVICE_H_ 3 | #define _DINGOO_MIDI_SERVICE_H_ 4 | 5 | #include "Services/Midi/MidiService.h" 6 | 7 | class DINGOOMidiService: public MidiService { 8 | public: 9 | DINGOOMidiService() ; 10 | ~DINGOOMidiService() ; 11 | protected: 12 | virtual void buildDriverList() ; 13 | 14 | } ; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _DINGOO_SERIAL_MIDI_DEVICE_H_ 2 | #define _DINGOO_SERIAL_MIDI_DEVICE_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | 6 | #include 7 | 8 | class DINGOOSerialMidiDevice: public MidiOutDevice { 9 | public: 10 | DINGOOSerialMidiDevice() ; 11 | virtual bool Init() ; 12 | virtual void Close() ; 13 | virtual bool Start() ; 14 | virtual void Stop(); 15 | 16 | protected: 17 | virtual void SendMessage(MidiMessage &) ; 18 | private: 19 | struct termios oldtio_; 20 | int fd_ ; 21 | 22 | 23 | } ; 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/System/DINGOOEventQueue.cpp: -------------------------------------------------------------------------------- 1 | #include "DINGOOEventQueue.h" 2 | 3 | DINGOOEventQueue::DINGOOEventQueue(): 4 | T_Stack(true) { 5 | } 6 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/System/DINGOOEventQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _DINGOO_EVENT_QUEUE_H_ 2 | #define _DINGOO_EVENT_QUEUE_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "Foundation/T_Stack.h" 6 | 7 | enum DINGOOEventType { 8 | DINGOOET_REDRAW 9 | } ; 10 | 11 | class DINGOOEvent { 12 | public: 13 | DINGOOEventType type_; 14 | } ; 15 | 16 | class DINGOOEventQueue: public T_Singleton,public T_Stack { 17 | public: 18 | DINGOOEventQueue() ; 19 | } ; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/System/DINGOOSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPSDL_SYSTEM_H_ 2 | #define _GPSDL_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 6 | #include 7 | 8 | #define USEREVENT_TIMER 0 9 | #define USEREVENT_EXPOSE 1 10 | 11 | class GPSDLSystem: public System { 12 | public: 13 | static void Boot(int argc,char **argv) ; 14 | static void Shutdown() ; 15 | static int MainLoop() ; 16 | 17 | public: // System implementation 18 | virtual unsigned long GetClock() ; 19 | virtual int GetBatteryLevel() ; 20 | virtual void Sleep(int millisec); 21 | virtual void *Malloc(unsigned size) ; 22 | virtual void Free(void *) ; 23 | virtual void Memset(void *addr,char val,int size) ; 24 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 25 | virtual void PostQuitMessage() ; 26 | virtual unsigned int GetMemoryUsage() ; 27 | 28 | private: 29 | static bool invert_ ; 30 | static int lastBattLevel_ ; 31 | static unsigned int lastBeatCount_ ; 32 | static EventManager *eventManager_; 33 | } ; 34 | #endif 35 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/UI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "DINGOOGUIWindowImp.h" 3 | 4 | 5 | GUIFactory::GUIFactory() { 6 | } ; 7 | 8 | 9 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 10 | return *(new DINGOOGUIWindowImp(p)) ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Adapters/DINGOO/UI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef DINGOO_GUI_FACTORY_H_ 2 | #define DINGOO_GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory: public I_GUIWindowFactory { 7 | 8 | 9 | 10 | public: 11 | 12 | GUIFactory() ; 13 | 14 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 15 | 16 | } ; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Audio/DummyAudio.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DummyAudio.h" 3 | #include "DummyAudioDriver.h" 4 | #include "Services/Audio/AudioOut.h" 5 | #include "System/io/Trace.h" 6 | 7 | DummyAudio::DummyAudio() { 8 | } 9 | 10 | DummyAudio::~DummyAudio() { 11 | } 12 | 13 | void DummyAudio::Init() { 14 | DummyAudioDriver *drv=new DummyAudioDriver() ; 15 | AudioOut *out=new AudioOut(*drv) ; 16 | Insert(out) ; 17 | } ; 18 | 19 | void DummyAudio::Close() { 20 | IteratorPtrit(GetIterator()) ; 21 | for (it->Begin();!it->IsDone();it->Next()) { 22 | AudioOut ¤t=it->CurrentItem() ; 23 | current.Close() ; 24 | } 25 | } ; 26 | 27 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Audio/DummyAudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _DUMMYAUDIO_H_ 2 | #define _DUMMYAUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | 6 | class DummyAudio: public Audio { 7 | public: 8 | DummyAudio() ; 9 | ~DummyAudio() ; 10 | virtual void Init() ; 11 | virtual void Close() ; 12 | }; 13 | #endif 14 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Audio/DummyAudioDriver.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DummyAudioDriver.h" 3 | 4 | bool DummyAudioDriver::InitDriver() { 5 | 6 | return true ; 7 | } ; 8 | 9 | 10 | void DummyAudioDriver::CloseDriver() { 11 | 12 | } ; 13 | 14 | bool DummyAudioDriver::StartDriver() { 15 | return 1 ; 16 | } ; 17 | 18 | void DummyAudioDriver::StopDriver() { 19 | } ; 20 | 21 | 22 | int DummyAudioDriver::GetPlayedBufferPercentage() { 23 | return 0 ; 24 | } ; 25 | 26 | int DummyAudioDriver::GetSampleRate(){ 27 | return 44100 ; 28 | } ; 29 | 30 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Audio/DummyAudioDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef _DUMMY_AUDIODRIVER_H_ 2 | #define _DUMMY_AUDIODRIVER_H_ 3 | 4 | #include "Services/Audio/AudioDriver.h" 5 | 6 | class DummyAudioDriver: public AudioDriver { 7 | public: 8 | // Sound implementation 9 | virtual bool InitDriver() ; 10 | virtual void CloseDriver(); 11 | virtual bool StartDriver() ; 12 | virtual void StopDriver(); 13 | virtual int GetPlayedBufferPercentage() ; 14 | virtual int GetSampleRate() ; 15 | virtual bool Interlaced() { return true ; } ; 16 | } ; 17 | #endif 18 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DummyFileSystem.h" 3 | #include "system/io/Trace.h" 4 | #include "Application/Utils/wildcard.h" 5 | #include 6 | 7 | 8 | 9 | I_File *DummyFileSystem::Open(const char *path,char *mode) { 10 | return 0 ; 11 | } ; 12 | 13 | 14 | I_Dir *DummyFileSystem::Open(const char *path) { 15 | return 0 ; 16 | } ; 17 | 18 | FileType DummyFileSystem::GetFileType(const char *path) { 19 | return FT_UNKNOWN ; 20 | } ; 21 | 22 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/FileSystem/DummyFileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DUMMY_FILESYSTEM_H_ 3 | #define _DUMMY_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | #include 8 | 9 | 10 | class DummyFileSystem: public FileSystem { 11 | public: 12 | virtual I_File *Open(const char *path,char *mode); 13 | virtual I_Dir *Open(const char *path) ; 14 | virtual FileType GetFileType(const char *path) ; 15 | virtual void MakeDir(const char *path) {} ; 16 | virtual void Delete(const char *) {} ; 17 | 18 | } ; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Midi/DummyMidi.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DummyMidi.h" 3 | 4 | DummyMidi::DummyMidi() { 5 | } ; 6 | 7 | DummyMidi::~DummyMidi() { 8 | } ; 9 | 10 | void DummyMidi::buildDriverList() { 11 | } ; 12 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Midi/DummyMidi.h: -------------------------------------------------------------------------------- 1 | #ifndef _DUMMY_MIDI_H_ 2 | #define _DUMMY_MIDI_H_ 3 | 4 | #include "Services/Midi/MidiService.h" 5 | 6 | class DummyMidi: public MidiService { 7 | public: 8 | DummyMidi() ; 9 | ~DummyMidi() ; 10 | virtual void buildDriverList() ; 11 | 12 | } ; 13 | #endif 14 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Sound/DummySound.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DummySound.h" 3 | 4 | bool DummySound::Init() { 5 | 6 | return true ; 7 | } ; 8 | 9 | 10 | void DummySound::Close() { 11 | 12 | } ; 13 | 14 | bool DummySound::Start() { 15 | return 1 ; 16 | } ; 17 | 18 | void DummySound::Stop() { 19 | } ; 20 | 21 | 22 | // length here is in bytes 23 | 24 | void DummySound::QueueBuffer(char *buffer,int len) { 25 | 26 | } 27 | 28 | 29 | int DummySound::GetPlayedBufferPercentage() { 30 | return 0 ; 31 | } ; 32 | 33 | int DummySound::GetSampleRate(){ 34 | return 44100 ; 35 | } ; 36 | 37 | -------------------------------------------------------------------------------- /sources/Adapters/Dummy/Sound/DummySound.h: -------------------------------------------------------------------------------- 1 | #ifndef _DUMMY_SOUND_H_ 2 | #define _DUMMY_SOUND_H_ 3 | 4 | #include "System/Sound/Sound.h" 5 | class DummySound: public Sound { 6 | public: 7 | // Sound implementation 8 | virtual bool Init() ; 9 | virtual void Close(); 10 | virtual bool Start() ; 11 | virtual void Stop(); 12 | virtual void QueueBuffer(char *buffer,int len) ; 13 | virtual int GetPlayedBufferPercentage() ; 14 | virtual int GetSampleRate() ; 15 | } ; 16 | #endif 17 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/Audio/GP2XAudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _GP2XAUDIO_H_ 2 | #define _GP2XAUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | 6 | class GP2XAudio: public Audio { 7 | public: 8 | GP2XAudio(AudioSettings &settings) ; 9 | ~GP2XAudio() ; 10 | virtual void Init() ; 11 | virtual void Close() ; 12 | virtual int GetMixerVolume() ; 13 | virtual void SetMixerVolume(int volume) ; 14 | }; 15 | #endif 16 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/Audio/GP2XAudioDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef _GP2X_SOUND_H_ 2 | #define _GP2X_SOUND_H_ 3 | 4 | #include "Services/Audio/AudioDriver.h" 5 | 6 | 7 | class GP2XAudioDriver:public AudioDriver { 8 | public: 9 | GP2XAudioDriver(AudioSettings &settings) ; 10 | virtual ~GP2XAudioDriver() ; 11 | 12 | // Sound implementation 13 | virtual bool InitDriver() ; 14 | virtual void CloseDriver(); 15 | virtual bool StartDriver() ; 16 | virtual void StopDriver(); 17 | virtual int GetPlayedBufferPercentage() ; 18 | virtual int GetSampleRate() { return 44100 ; } ; 19 | virtual bool Interlaced() { return true ; } ; 20 | virtual double GetStreamTime() ; 21 | // Additional 22 | void OnChunkDone() ; 23 | void SetVolume(int v) ; 24 | int GetVolume() ; 25 | void NewBuffer() ; 26 | private: 27 | AudioSettings settings_ ; 28 | int fragSize_ ; 29 | char *unalignedMain_ ; 30 | char *mainBuffer_ ; 31 | char *miniBlank_ ; 32 | int bufferPos_ ; 33 | int bufferSize_ ; 34 | int volume_ ; 35 | int ticksBeforeMidi_ ; 36 | unsigned long streamSampleTime_ ; 37 | } ; 38 | #endif 39 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/FileSystem/GP2XFileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GP2X_FILESYSTEM_H_ 3 | #define _GP2X_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | 8 | class GP2XFile: public I_File { 9 | public: 10 | GP2XFile(FILE *) ; 11 | virtual int Read(void *ptr, int size, int nmemb) ; 12 | virtual int Write(const void *ptr, int size, int nmemb) ; 13 | virtual void Printf(const char *format,...); 14 | virtual void Seek(long offset,int whence) ; 15 | virtual long Tell() ; 16 | 17 | virtual void Close() ; 18 | private: 19 | FILE *file_ ; 20 | } ; 21 | 22 | class GP2XDir: public I_Dir { 23 | public: 24 | GP2XDir(const char *path) ; 25 | virtual ~GP2XDir() {} ; 26 | virtual void GetContent(char *mask) ; 27 | } ; 28 | 29 | class GP2XFileSystem: public FileSystem { 30 | public: 31 | virtual I_File *Open(const char *path,char *mode); 32 | virtual I_Dir *Open(const char *path) ; 33 | virtual FileType GetFileType(const char *path) ; 34 | virtual Result MakeDir(const char *path) ; 35 | virtual void Delete(const char *path) ; 36 | } ; 37 | #endif 38 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/Main/GPSDLMain.cpp: -------------------------------------------------------------------------------- 1 | // VC6GUI.cpp : Defines the entry point for the application. 2 | // 3 | 4 | #include "Application/Application.h" 5 | #include "Adapters/GP2X/System/GP2XSystem.h" 6 | #include "Foundation/T_Singleton.h" 7 | #include 8 | #include 9 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 10 | #include "Application/Persistency/PersistencyService.h" 11 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 12 | 13 | int main(int argc,char *argv[]) 14 | { 15 | GPSDLSystem::Boot(argc,argv) ; 16 | 17 | SDLCreateWindowParams params ; 18 | params.title="littlegptracker" ; 19 | params.cacheFonts_=true ; 20 | params.framebuffer_=true ; 21 | Application::GetInstance()->Init(params) ; 22 | 23 | GPSDLSystem::MainLoop() ; 24 | GPSDLSystem::Shutdown() ; 25 | chdir("/usr/gp2x"); 26 | execl("gp2xmenu","gp2xmenu",NULL); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/Midi/GP2XMidiService.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GP2XMidiService.h" 3 | #include "GP2XSerialMidiDevice.h" 4 | 5 | GP2XMidiService::GP2XMidiService() { 6 | } ; 7 | 8 | GP2XMidiService::~GP2XMidiService() { 9 | } ; 10 | 11 | void GP2XMidiService::buildDriverList() {// Here we just loop over existing Midi out and create a midi device for each of them. 12 | 13 | Insert(new GP2XSerialMidiDevice()) ; 14 | 15 | } ; 16 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/Midi/GP2XMidiService.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GP2X_MIDI_SERVICE_H_ 3 | #define _GP2X_MIDI_SERVICE_H_ 4 | 5 | #include "Services/Midi/MidiService.h" 6 | 7 | class GP2XMidiService: public MidiService { 8 | public: 9 | GP2XMidiService() ; 10 | ~GP2XMidiService() ; 11 | protected: 12 | virtual void buildDriverList() ; 13 | 14 | } ; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _GP2X_SERIAL_MIDI_DEVICE_H_ 2 | #define _GP2X_SERIAL_MIDI_DEVICE_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | 6 | #include 7 | 8 | class GP2XSerialMidiDevice: public MidiOutDevice { 9 | public: 10 | GP2XSerialMidiDevice() ; 11 | virtual bool Init() ; 12 | virtual void Close() ; 13 | virtual bool Start() ; 14 | virtual void Stop(); 15 | 16 | protected: 17 | virtual void SendMessage(MidiMessage &) ; 18 | private: 19 | struct termios oldtio_; 20 | int fd_ ; 21 | 22 | 23 | } ; 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/System/GP2XEventQueue.cpp: -------------------------------------------------------------------------------- 1 | #include "GP2XEventQueue.h" 2 | 3 | GP2XEventQueue::GP2XEventQueue(): 4 | T_Stack(true) { 5 | } 6 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/System/GP2XEventQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _GP2X_EVENT_QUEUE_H_ 2 | #define _GP2X_EVENT_QUEUE_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "Foundation/T_Stack.h" 6 | 7 | enum GP2XEventType { 8 | GP2XET_REDRAW 9 | } ; 10 | 11 | class GP2XEvent { 12 | public: 13 | GP2XEventType type_; 14 | } ; 15 | 16 | class GP2XEventQueue: public T_Singleton,public T_Stack { 17 | public: 18 | GP2XEventQueue() ; 19 | } ; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/System/GP2XSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPSDL_SYSTEM_H_ 2 | #define _GPSDL_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 6 | #include 7 | 8 | #define USEREVENT_TIMER 0 9 | #define USEREVENT_EXPOSE 1 10 | 11 | class GPSDLSystem: public System { 12 | public: 13 | static void Boot(int argc,char **argv) ; 14 | static void Shutdown() ; 15 | static int MainLoop() ; 16 | 17 | public: // System implementation 18 | virtual unsigned long GetClock() ; 19 | virtual int GetBatteryLevel() ; 20 | virtual void Sleep(int millisec); 21 | virtual void *Malloc(unsigned size) ; 22 | virtual void Free(void *) ; 23 | virtual void Memset(void *addr,char val,int size) ; 24 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 25 | virtual void PostQuitMessage() ; 26 | virtual unsigned int GetMemoryUsage() ; 27 | 28 | private: 29 | static bool invert_ ; 30 | static int lastBattLevel_ ; 31 | static unsigned int lastBeatCount_ ; 32 | static EventManager *eventManager_; 33 | 34 | } ; 35 | #endif 36 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/UI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "GP2XGUIWindowImp.h" 3 | 4 | 5 | GUIFactory::GUIFactory() { 6 | } ; 7 | 8 | 9 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 10 | return *(new GP2XGUIWindowImp(p)) ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Adapters/GP2X/UI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef GP2X_GUI_FACTORY_H_ 2 | #define GP2X_GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory: public I_GUIWindowFactory { 7 | 8 | 9 | 10 | public: 11 | 12 | GUIFactory() ; 13 | 14 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 15 | 16 | } ; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/Jack/Audio/JackAudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _JACK_AUDIO_H_ 2 | #define _JACK_AUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | #include "jack/jack.h" 6 | 7 | class JackAudio: public Audio { 8 | public: 9 | JackAudio(AudioSettings &hints) ; 10 | ~JackAudio() ; 11 | virtual void Init() ; 12 | virtual void Close() ; 13 | }; 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Adapters/Jack/Client/JackClient.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _JACK_CLIENT_H_ 3 | #define _JACK_CLIENT_H_ 4 | 5 | #include "jack/jack.h" 6 | #include "Foundation/T_Singleton.h" 7 | #include "Foundation/T_SimpleList.h" 8 | 9 | class JackProcessor { 10 | public: 11 | virtual ~JackProcessor() {} ; 12 | virtual void ProcessCallback(jack_nframes_t nframes)=0 ; 13 | } ; 14 | 15 | class JackClient: public T_Singleton,public JackProcessor,public T_SimpleList { 16 | public: 17 | JackClient() ; 18 | virtual ~JackClient() ; 19 | bool Init() ; 20 | bool Available() ; 21 | jack_client_t* GetClient() ; 22 | virtual void ProcessCallback(jack_nframes_t nframes) ; 23 | private: 24 | jack_client_t* client_ ; 25 | } ; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sources/Adapters/Jack/Midi/JackMidiDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _W32_MIDI_H_ 2 | #define _W32_MIDI_H_ 3 | 4 | #include "Services/Midi/MidiDevice.h" 5 | #include 6 | #include "Adapters/Jack/Client/JackClient.h" 7 | #include 8 | 9 | class JackMidiDevice: public MidiDevice { 10 | public: 11 | JackMidiDevice(jack_client_t *client,const char *name) ; 12 | virtual ~JackMidiDevice() ; 13 | virtual bool Init() ; 14 | virtual void Close() ; 15 | virtual bool Start() ; 16 | virtual void Stop(); 17 | virtual void SendMessage(MidiMessage &m); 18 | 19 | void SetFrameOffset(int offset) ; 20 | void OnNewFrame() ; 21 | private: 22 | jack_client_t *client_ ; 23 | jack_port_t *port_ ; 24 | std::string portName_ ; 25 | int frameOffset_ ; 26 | } ; 27 | #endif 28 | -------------------------------------------------------------------------------- /sources/Adapters/Jack/Midi/JackMidiService.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _JACK_MIDI_SERVICE_H_ 3 | #define _JACK_MIDI_SERVICE_H_ 4 | 5 | #include "Services/Midi/MidiService.h" 6 | 7 | class JackMidiService: public MidiService { 8 | public: 9 | JackMidiService() ; 10 | ~JackMidiService() ; 11 | void SetFrameOffset(int offset) ; 12 | void OnNewFrame() ; 13 | protected: 14 | virtual void buildDriverList() ; 15 | 16 | } ; 17 | 18 | #endif -------------------------------------------------------------------------------- /sources/Adapters/NDS/FileSystem/NDSFileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _NDS_FILESYSTEM_H_ 3 | #define _NDS_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | 8 | class NDSFile: public I_File { 9 | public: 10 | NDSFile(FILE *) ; 11 | virtual int Read(void *ptr, int size, int nmemb) ; 12 | virtual int Write(const void *ptr, int size, int nmemb) ; 13 | virtual void Printf(const char *format,...); 14 | virtual void Seek(long offset,int whence) ; 15 | virtual long Tell() ; 16 | 17 | virtual void Close() ; 18 | private: 19 | FILE *file_ ; 20 | } ; 21 | 22 | class NDSDir: public I_Dir { 23 | public: 24 | NDSDir(const char *path) ; 25 | virtual ~NDSDir() {} ; 26 | virtual void GetContent(char *mask) ; 27 | } ; 28 | 29 | class NDSFileSystem: public FileSystem { 30 | public: 31 | NDSFileSystem() ; 32 | virtual I_File *Open(const char *path,char *mode); 33 | virtual I_Dir *Open(const char *path) ; 34 | char root_[1024] ; 35 | } ; 36 | #endif 37 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/Main/NDSmain.cpp: -------------------------------------------------------------------------------- 1 | #include "Application/Application.h" 2 | #include "Adapters/NDS/System/NDSSystem.h" 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc,char *argv[]) 8 | { 9 | REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR ; 10 | 11 | defaultExceptionHandler(); 12 | 13 | bool fullscreen=false ; 14 | if (argc>1) { 15 | fullscreen=!strcmp(argv[1],"-fullscreen") ; 16 | } 17 | 18 | powerON(POWER_ALL); 19 | irqInit(); 20 | 21 | consoleDemoInit(); 22 | 23 | BG_PALETTE[255] = RGB15(31,31,31); 24 | 25 | // irqSet(IRQ_VBLANK, on_irq_vblank); 26 | 27 | videoSetMode(MODE_FB0); 28 | vramSetBankA(VRAM_A_LCD); 29 | videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); 30 | 31 | printf("booting") ; 32 | NDSSystem::Boot() ; 33 | 34 | Application::Init(fullscreen) ; 35 | 36 | NDSSystem::MainLoop() ; 37 | 38 | Application::Cleanup() ; 39 | 40 | return 0; 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/System/NDSEventQueue.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GP32EventQueue.h" 3 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/System/NDSEventQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _NDS_EVENT_QUEUE_H_ 2 | #define _NDS_EVENT_QUEUE_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "Foundation/T_Stack.h" 6 | 7 | enum NDSEventType { 8 | NDSET_REDRAW, 9 | NDSET_ESC 10 | } ; 11 | 12 | class NDSEvent { 13 | public: 14 | NDSEventType type_; 15 | } ; 16 | 17 | class NDSEventQueue: public T_Singleton,public T_Stack { 18 | } ; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/System/NDSSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _NDS_SYSTEM_H_ 2 | #define _NDS_SYSTEM_H_ 3 | 4 | 5 | 6 | #include "System/System/System.h" 7 | #include "System/System/typedefs.h" 8 | 9 | class NDSSystem: public System { 10 | public: 11 | static void Boot() ; 12 | static void Shutdown() ; 13 | static int MainLoop() ; 14 | 15 | public: // System implementation 16 | virtual unsigned long GetClock() ; 17 | virtual void *Malloc(unsigned size) ; 18 | virtual void Free(void *) ; 19 | virtual int GetBatteryLevel() ; 20 | virtual void AddUserLog(const char *) ; 21 | virtual void PostQuitMessage() ; 22 | virtual void Memset(void *addr,char val,int size) ; 23 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 24 | protected: 25 | static void ProcessOneEvent() ; 26 | private: 27 | static bool finished_ ; 28 | static bool redrawing_ ; 29 | static uint16 buttonMask_ ; 30 | static unsigned int keyRepeat_ ; 31 | static unsigned int keyDelay_ ; 32 | static unsigned int keyKill_ ; 33 | static bool isRepeating_ ; 34 | static unsigned long time_ ; 35 | static bool escPressed_ ; 36 | } ; 37 | #endif 38 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/UI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "NDSGUIWindowImp.h" 3 | 4 | 5 | GUIFactory::GUIFactory() { 6 | } ; 7 | 8 | 9 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 10 | return *(new NDSGUIWindowImp(p)) ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/UI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_GUI_FACTORY_H_ 2 | #define WIN32_GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory: public I_GUIWindowFactory { 7 | 8 | 9 | 10 | public: 11 | 12 | GUIFactory() ; 13 | 14 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 15 | 16 | } ; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/NDS/UI/NDSGUIWindowImp.h: -------------------------------------------------------------------------------- 1 | #ifndef WSDL_GUI_WINDOW_H_ 2 | #define WSDL_GUI_WINDOW_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowImp.h" 5 | #include "Adapters/NDS/System/NDSEventQueue.h" 6 | #include "System/System/typedefs.h" 7 | 8 | class NDSGUIWindowImp: public I_GUIWindowImp { 9 | 10 | public: 11 | 12 | NDSGUIWindowImp(GUICreateWindowParams &p) ; 13 | virtual ~NDSGUIWindowImp() ; 14 | 15 | public: // I_GUIWindowImp implementation 16 | 17 | virtual void SetColor(GUIColor &) ; 18 | virtual void DrawString(char *string,GUIPoint &pos,GUITextProperties &); 19 | virtual GUIRect GetRect() ; 20 | virtual void Invalidate() ; 21 | virtual void Save() ; 22 | virtual void Restore() ; 23 | virtual void Flush(); 24 | virtual void Clear(GUIColor &) ; 25 | 26 | static void ProcessEvent(NDSEvent &event) ; 27 | static void ProcessButtonChange(uint16 changeMask,uint16 buttonMask); 28 | private: 29 | unsigned short* framebuffer_; 30 | unsigned short frontColor_ ; 31 | unsigned short backColor_ ; 32 | GUIRect rect_ ; 33 | } ; 34 | #endif 35 | -------------------------------------------------------------------------------- /sources/Adapters/OSX/OSXMain/OSXmain.cpp: -------------------------------------------------------------------------------- 1 | #include "Application/Application.h" 2 | #include "Adapters/OSX/OSXSystem/OSXSystem.h" 3 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 4 | 5 | #include 6 | 7 | int main(int argc,char *argv[]) 8 | { 9 | OSXSystem::Boot(argc,argv) ; 10 | 11 | SDLCreateWindowParams params ; 12 | params.title="littlegptracker" ; 13 | params.cacheFonts_=false ; 14 | 15 | Application::GetInstance()->Init(params) ; 16 | 17 | int retval=OSXSystem::MainLoop() ; 18 | 19 | return retval ; 20 | } 21 | -------------------------------------------------------------------------------- /sources/Adapters/OSX/OSXMain/SDLMain.h: -------------------------------------------------------------------------------- 1 | /* SDLMain.m - main entry point for our Cocoa-ized SDL app 2 | Initial Version: Darrell Walisser 3 | Non-NIB-Code & other changes: Max Horn 4 | 5 | Feel free to customize this file to suit your needs 6 | */ 7 | 8 | #import 9 | 10 | @interface SDLMain : NSObject 11 | @end 12 | -------------------------------------------------------------------------------- /sources/Adapters/OSX/OSXSystem/OSXSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSX_SYSTEM_H_ 2 | #define _OSX_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 6 | 7 | // TODO: Check how I can have a single place for all SDL based code 8 | // So I don't have to check all of the System::MainLoop() 9 | 10 | class OSXSystem: public System { 11 | public: 12 | static void Boot(int argc,char **argv) ; 13 | static void Shutdown() ; 14 | static int MainLoop() ; 15 | 16 | public: // System implementation 17 | virtual unsigned long GetClock() ; 18 | virtual void Sleep(int millisec); 19 | virtual void *Malloc(unsigned size) ; 20 | virtual void Free(void *) ; 21 | virtual void Memset(void *addr,char val,int size) ; 22 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 23 | virtual int GetBatteryLevel() { return -1 ; } ; 24 | virtual void PostQuitMessage() ; 25 | virtual unsigned int GetMemoryUsage() ; 26 | static bool finished_ ; 27 | protected: 28 | static void installAliases(); 29 | private: 30 | static EventManager *eventManager_; 31 | } ; 32 | #endif 33 | -------------------------------------------------------------------------------- /sources/Adapters/PSP/System/PSPSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _PSP_SYSTEM_H_ 2 | #define _PSP_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 6 | 7 | class PSPSystem: public System { 8 | public: 9 | static void Boot(int argc,char **argv) ; 10 | static void Shutdown() ; 11 | static int MainLoop() ; 12 | 13 | public: // System implementation 14 | virtual unsigned long GetClock() ; 15 | virtual void Sleep(int millisec); 16 | virtual void *Malloc(unsigned size) ; 17 | virtual void Free(void *) ; 18 | virtual void Memset(void *addr,char val,int size) ; 19 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 20 | virtual int GetBatteryLevel() { return -1 ; } ; 21 | virtual void PostQuitMessage() ; 22 | virtual unsigned int GetMemoryUsage() ; 23 | 24 | static bool finished_ ; 25 | private: 26 | static std::string eboot_ ; 27 | static EventManager *eventManager_; 28 | 29 | } ; 30 | #endif 31 | -------------------------------------------------------------------------------- /sources/Adapters/RTAudio/RTAudioStub.h: -------------------------------------------------------------------------------- 1 | #ifndef _RTAUDIO_STUB_H_ 2 | #define _RTAUDIO_STUB_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | #include "Externals/RTAudio/RtAudio.h" 6 | 7 | class RTAudioStub: public Audio { 8 | public: 9 | RTAudioStub(AudioSettings &settings) ; 10 | ~RTAudioStub() ; 11 | virtual void Init() ; 12 | virtual void Close() ; 13 | virtual int GetSampleRate() ; 14 | private: 15 | RtAudio::Api api_ ; 16 | std::string selectedDevice_ ; 17 | int index_ ; // index of the device to open 18 | int sampleRate_ ; 19 | }; 20 | #endif 21 | -------------------------------------------------------------------------------- /sources/Adapters/RTMidi/RTMidiInDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _RT_MIDIIN_DEVICE_H_ 2 | #define _RT_MIDIIN_DEVICE_H_ 3 | 4 | #include "Services/Midi/MidiInDevice.h" 5 | #include "Externals/RtMidi/RtMidi.h" 6 | 7 | class RTMidiInDevice:public MidiInDevice { 8 | public: 9 | RTMidiInDevice(int index,const char *name) ; 10 | ~RTMidiInDevice() ; 11 | 12 | void SendDriverMessage(MidiMessage &message) ; 13 | 14 | private: 15 | 16 | // Driver specific initialisation 17 | 18 | virtual bool initDriver() ; 19 | virtual void closeDriver() ; 20 | virtual bool startDriver() ; 21 | virtual void stopDriver() ; 22 | 23 | RtMidiIn rtMidiIn_ ; 24 | int index_ ; 25 | } ; 26 | #endif -------------------------------------------------------------------------------- /sources/Adapters/RTMidi/RTMidiOutDevice.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "RTMidiOutDevice.h" 3 | #include "System/Console/Trace.h" 4 | 5 | 6 | RTMidiOutDevice::RTMidiOutDevice(RtMidiOut &out,int index,const char *name): 7 | MidiOutDevice(name), 8 | rtMidiOut_(out), 9 | running_(false), 10 | index_(index) 11 | { 12 | } ; 13 | 14 | RTMidiOutDevice::~RTMidiOutDevice() { 15 | } ; 16 | 17 | bool RTMidiOutDevice::Init(){ 18 | return true ; 19 | } ; 20 | 21 | void RTMidiOutDevice::Close(){ 22 | } ; 23 | 24 | bool RTMidiOutDevice::Start(){ 25 | rtMidiOut_.openPort( index_ ); 26 | running_=true ; 27 | return true ; 28 | } ; 29 | 30 | void RTMidiOutDevice::Stop(){ 31 | running_=false ; 32 | rtMidiOut_.closePort() ; 33 | } ; 34 | 35 | void RTMidiOutDevice::SendMessage(MidiMessage &msg) 36 | { 37 | if (running_) 38 | { 39 | std::vector message; 40 | message.push_back(msg.status_) ; 41 | 42 | if (msg.data1_ != MidiMessage::UNUSED_BYTE) 43 | { 44 | message.push_back(msg.data1_) ; 45 | } 46 | 47 | if (msg.data2_ != MidiMessage::UNUSED_BYTE) 48 | { 49 | message.push_back(msg.data2_) ; 50 | } 51 | rtMidiOut_.sendMessage( &message ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sources/Adapters/RTMidi/RTMidiOutDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _RT_MIDIOUT_H_ 2 | #define _RT_MIDIOUT_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | #include "Externals/RtMidi/RtMidi.h" 6 | 7 | class RTMidiOutDevice: public MidiOutDevice { 8 | public: 9 | RTMidiOutDevice(RtMidiOut &out,int index,const char *name) ; 10 | virtual ~RTMidiOutDevice() ; 11 | virtual bool Init() ; 12 | virtual void Close() ; 13 | virtual bool Start() ; 14 | virtual void Stop(); 15 | virtual void SendMessage(MidiMessage &m); 16 | private: 17 | RtMidiOut rtMidiOut_ ; 18 | int index_ ; 19 | bool running_ ; 20 | } ; 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Adapters/RTMidi/RTMidiService.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _RT_MIDI_SERVICE_H_ 3 | #define _W32_MIDI_SERVICE_H_ 4 | 5 | #include "Services/Midi/MidiService.h" 6 | #include "Externals/RtMidi/RtMidi.h" 7 | 8 | class RTMidiService: public MidiService { 9 | public: 10 | RTMidiService() ; 11 | ~RTMidiService() ; 12 | protected: 13 | virtual void buildDriverList() ; 14 | int midiDelay_ ; 15 | RtMidiIn *rtMidiIn_ ; 16 | RtMidiOut *rtMidiOut_ ; 17 | } ; 18 | 19 | #endif -------------------------------------------------------------------------------- /sources/Adapters/SDL/Audio/SDLAudio.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "SDLAudio.h" 3 | #include "SDLAudioDriver.h" 4 | #include "Services/Audio/AudioOutDriver.h" 5 | 6 | SDLAudio::SDLAudio(AudioSettings &hints):Audio(hints) { 7 | hints_=hints; 8 | } 9 | 10 | SDLAudio::~SDLAudio() { 11 | } 12 | 13 | void SDLAudio::Init() { 14 | AudioSettings settings ; 15 | settings.audioAPI_=GetAudioAPI(); 16 | 17 | settings.bufferSize_=GetAudioBufferSize() ; 18 | settings.preBufferCount_=GetAudioPreBufferCount() ; 19 | 20 | 21 | SDLAudioDriver *drv=new SDLAudioDriver(settings) ; 22 | AudioOut *out=new AudioOutDriver(*drv) ; 23 | Insert(out) ; 24 | } ; 25 | 26 | void SDLAudio::Close() { 27 | IteratorPtrit(GetIterator()) ; 28 | for (it->Begin();!it->IsDone();it->Next()) { 29 | AudioOut ¤t=it->CurrentItem() ; 30 | current.Close() ; 31 | } 32 | } ; 33 | 34 | int SDLAudio::GetMixerVolume() { 35 | return 100 ; 36 | } ; 37 | 38 | void SDLAudio::SetMixerVolume(int volume) { 39 | } ; 40 | -------------------------------------------------------------------------------- /sources/Adapters/SDL/Audio/SDLAudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _SDL_AUDIO_H_ 2 | #define _SDL_AUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | 6 | class SDLAudio: public Audio { 7 | public: 8 | SDLAudio(AudioSettings &hints) ; // Allow for different default size for different platform 9 | ~SDLAudio() ; 10 | virtual void Init() ; 11 | virtual void Close() ; 12 | virtual int GetMixerVolume() ; 13 | virtual void SetMixerVolume(int volume) ; 14 | private: 15 | AudioSettings hints_ ; 16 | }; 17 | #endif 18 | -------------------------------------------------------------------------------- /sources/Adapters/SDL/GUI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "SDLGUIWindowImp.h" 3 | #include "SDLEventManager.h" 4 | #ifndef _USE_NCURSES_ 5 | 6 | 7 | GUIFactory::GUIFactory() { 8 | } ; 9 | 10 | 11 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 12 | return *(new SDLGUIWindowImp(p)) ; 13 | } 14 | 15 | EventManager *GUIFactory::GetEventManager() { 16 | return SDLEventManager::GetInstance() ; 17 | } 18 | #endif -------------------------------------------------------------------------------- /sources/Adapters/SDL/GUI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef SDL_GUI_FACTORY_H_ 2 | #define SDL_GUI_FACTORY_H_ 3 | 4 | #ifndef _USE_NCURSES_ 5 | 6 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 7 | 8 | class GUIFactory: public I_GUIWindowFactory { 9 | 10 | public: 11 | GUIFactory() ; 12 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 13 | virtual EventManager *GetEventManager() ; 14 | 15 | } ; 16 | 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Adapters/SDL/Input/SDLInput.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDL_INPUT_H_ 3 | #define _SDL_INPUT_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "Externals/SDL/SDL.h" 7 | 8 | #define SDLI_BUTTON_A 0x1 9 | #define SDLI_BUTTON_B 0x2 10 | #define SDLI_BUTTON_LEFT 0x4 11 | #define SDLI_BUTTON_RIGHT 0x8 12 | #define SDLI_BUTTON_UP 0x10 13 | #define SDLI_BUTTON_DOWN 0x20 14 | #define SDLI_BUTTON_L 0x40 15 | #define SDLI_BUTTON_R 0x80 16 | #define SDLI_BUTTON_START 0x100 17 | #define SDLI_BUTTON_SELECT 0x200 18 | 19 | 20 | class SDLInput: public T_Singleton { 21 | public: 22 | SDLInput() ; 23 | void ReadConfig(); 24 | unsigned short GetButtonMask() ; 25 | 26 | private: 27 | void mapKey(int index,const char *keyname) ; 28 | 29 | SDL_Joystick *joystick_; 30 | 31 | const char *keyname_[SDLK_LAST] ; 32 | 33 | } ; 34 | 35 | #endif -------------------------------------------------------------------------------- /sources/Adapters/SDL/Process/SDLProcess.h: -------------------------------------------------------------------------------- 1 | #ifndef _SDL_PROCESS_H_ 2 | #define _SDL_PROCESS_H_ 3 | 4 | #include "System/Process/Process.h" 5 | #include 6 | 7 | class SDLProcessFactory:public SysProcessFactory { 8 | bool BeginThread(SysThread &) ; 9 | virtual SysSemaphore *CreateNewSemaphore(int initialcount = 0, int maxcount = 0) ; 10 | } ; 11 | 12 | class SDLSysSemaphore:public SysSemaphore { 13 | public: 14 | SDLSysSemaphore(int initialcount = 0, int maxcount = 0) ; 15 | virtual ~SDLSysSemaphore() ; 16 | virtual SysSemaphoreResult Wait() ; 17 | virtual SysSemaphoreResult TryWait() ; 18 | virtual SysSemaphoreResult WaitTimeout(unsigned long) ; 19 | virtual SysSemaphoreResult Post() ; 20 | private: 21 | SDL_sem *handle_ ; 22 | } ; 23 | #endif 24 | -------------------------------------------------------------------------------- /sources/Adapters/SDL/Timer/SDLTimer.h: -------------------------------------------------------------------------------- 1 | #ifndef _SDL_TIMER_H_ 2 | #define _SDL_TIMER_H_ 3 | 4 | #include "System/Timer/Timer.h" 5 | #include "SDL/SDL.h" 6 | 7 | class SDLTimer: public I_Timer { 8 | public: 9 | SDLTimer() ; 10 | virtual ~SDLTimer() ; 11 | virtual void SetPeriod(float msec) ; 12 | virtual bool Start() ; 13 | virtual void Stop() ; 14 | virtual float GetPeriod() ; 15 | Uint32 OnTimerTick() ; 16 | 17 | private: 18 | float period_ ; 19 | float offset_ ; // Float offset taking into account 20 | // period is an int 21 | SDL_TimerID timer_ ; // NULL if not running 22 | long lastTick_ ; 23 | bool running_ ; 24 | } ; 25 | 26 | class SDLTimerService: public TimerService { 27 | public: 28 | virtual I_Timer *CreateTimer() ; // Returns a timer 29 | virtual void TriggerCallback(int msec,timerCallback cb) ; 30 | }; 31 | 32 | #endif -------------------------------------------------------------------------------- /sources/Adapters/Unix/FileSystem/UnixFileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _UNIX_FILESYSTEM_H_ 3 | #define _UNIX_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | 8 | class UnixFile: public I_File { 9 | public: 10 | UnixFile(FILE *) ; 11 | virtual int Read(void *ptr, int size, int nmemb) ; 12 | virtual int Write(const void *ptr, int size, int nmemb) ; 13 | virtual void Printf(const char *format,...); 14 | virtual void Seek(long offset,int whence) ; 15 | virtual long Tell() ; 16 | virtual void Close() ; 17 | private: 18 | FILE *file_ ; 19 | } ; 20 | 21 | class UnixDir: public I_Dir { 22 | public: 23 | UnixDir(const char *path) ; 24 | virtual ~UnixDir() {} ; 25 | virtual void GetContent(char *mask) ; 26 | virtual void GetProjectContent() ; 27 | } ; 28 | 29 | class UnixFileSystem: public FileSystem { 30 | public: 31 | UnixFileSystem() ; 32 | virtual I_File *Open(const char *path,char *mode); 33 | virtual I_Dir *Open(const char *path) ; 34 | virtual Result MakeDir(const char *path) ; 35 | virtual void Delete(const char *path) ; 36 | virtual FileType GetFileType(const char *path) ; 37 | } ; 38 | #endif 39 | -------------------------------------------------------------------------------- /sources/Adapters/Unix/Process/UnixProcess.h: -------------------------------------------------------------------------------- 1 | #ifndef _Unix_PROCESS_H_ 2 | #define _Unix_PROCESS_H_ 3 | 4 | #include "System/Process/Process.h" 5 | #include 6 | #include 7 | 8 | class UnixProcessFactory:public SysProcessFactory { 9 | bool BeginThread(SysThread &) ; 10 | virtual SysSemaphore *CreateNewSemaphore(int initialcount = 0, int maxcount = 0) ; 11 | } ; 12 | 13 | class UnixSysSemaphore:public SysSemaphore { 14 | public: 15 | UnixSysSemaphore(int initialcount = 0, int maxcount = 0) ; 16 | virtual ~UnixSysSemaphore() ; 17 | virtual SysSemaphoreResult Wait() ; 18 | virtual SysSemaphoreResult TryWait() ; 19 | virtual SysSemaphoreResult WaitTimeout(unsigned long) ; 20 | virtual SysSemaphoreResult Post() ; 21 | private: 22 | sem_t *sem_ ; 23 | } ; 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Adapters/W32/Audio/W32Audio.h: -------------------------------------------------------------------------------- 1 | #ifndef _W32AUDIO_H_ 2 | #define _W32AUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | 6 | class W32Audio: public Audio { 7 | public: 8 | W32Audio(AudioSettings &settings) ; // use NULL for midi mapper 9 | ~W32Audio() ; 10 | virtual void Init() ; 11 | virtual void Close() ; 12 | virtual int GetSampleRate() ; 13 | private: 14 | int index_ ; // index of the device to open 15 | int sampleRate_ ; 16 | }; 17 | #endif 18 | -------------------------------------------------------------------------------- /sources/Adapters/W32/Audio/W32AudioDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef _W32_SOUND_H_ 2 | #define _W32_SOUND_H_ 3 | 4 | #include "Services/Audio/AudioDriver.h" 5 | #include "Foundation/T_Stack.h" 6 | #include 7 | 8 | struct W32SoundBuffer { 9 | WAVEHDR *wavHeader_ ; 10 | int index_ ; // poolindex 11 | } ; 12 | 13 | class W32AudioDriver: public AudioDriver { 14 | public: 15 | W32AudioDriver(int index,AudioSettings &settings) ; 16 | // Audio implementation 17 | virtual bool InitDriver() ; 18 | virtual void CloseDriver(); 19 | virtual bool StartDriver() ; 20 | virtual void StopDriver(); 21 | virtual int GetPlayedBufferPercentage() { return 0 ;} ; 22 | virtual int GetSampleRate() { return 44100; } ; 23 | virtual bool Interlaced() { return true ; } ; 24 | virtual double GetStreamTime() ; 25 | // Additional 26 | void OnChunkDone(W32SoundBuffer *) ; 27 | protected: 28 | void sendNextChunk(bool notify=true) ; 29 | void clearPlayedChunk(W32SoundBuffer *) ; 30 | private: 31 | double streamTime_ ; 32 | int index_ ; 33 | int ticksBeforeMidi_ ; 34 | HWAVEOUT waveOut_ ; 35 | } ; 36 | #endif 37 | -------------------------------------------------------------------------------- /sources/Adapters/W32/Main/WSDLmain.cpp: -------------------------------------------------------------------------------- 1 | // VC6GUI.cpp : Defines the entry point for the application. 2 | // 3 | 4 | #include "Application/Application.h" 5 | #include "Adapters/WSDLSystem/WSDLSystem.h" 6 | #include "Externals/SDL/SDL.h" 7 | #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" 8 | #include 9 | 10 | int main(int argc,char *argv[]) 11 | { 12 | bool fullscreen=false ; 13 | if (argc>1) { 14 | fullscreen=!strcmp(argv[1],"-fullscreen") ; 15 | } 16 | WSDLSystem::Boot(argc,argv) ; 17 | 18 | #ifdef _SHOW_GP2X_ 19 | GUIRect rect(0,0,640,480) ; 20 | #else 21 | GUIRect rect(0,0,320,240) ; 22 | #endif 23 | SDLCreateWindowParams params ; 24 | params.title="littlegptracker" ; 25 | params.cacheFonts_=true ; 26 | 27 | Application::GetInstance()->Init(params) ; 28 | 29 | int retval=WSDLSystem::MainLoop() ; 30 | 31 | WSDLSystem::Shutdown() ; 32 | return retval ; 33 | } 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /sources/Adapters/W32/Midi/W32MidiDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _W32_MIDI_H_ 2 | #define _W32_MIDI_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | #include 6 | 7 | #ifdef SendMessage 8 | #undef SendMessage 9 | #endif 10 | 11 | class W32MidiDevice: public MidiOutDevice { 12 | public: 13 | W32MidiDevice(const char *name) ; 14 | virtual ~W32MidiDevice() ; 15 | virtual bool Init() ; 16 | virtual void Close() ; 17 | virtual bool Start() ; 18 | virtual void Stop(); 19 | virtual void SendMessage(MidiMessage &m); 20 | private: 21 | HMIDIOUT midiOut_ ; 22 | } ; 23 | #endif 24 | -------------------------------------------------------------------------------- /sources/Adapters/W32/Midi/W32MidiService.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "W32MidiService.h" 3 | #include "W32MidiDEvice.h" 4 | #include "System/io/Trace.h" 5 | 6 | W32MidiService::W32MidiService() { 7 | } ; 8 | 9 | W32MidiService::~W32MidiService() { 10 | } ; 11 | 12 | void W32MidiService::buildDriverList() {// Here we just loop over existing Midi out and create a midi device for each of them. 13 | 14 | for (unsigned int i=0;i 6 | 7 | class W32ProcessFactory:public SysProcessFactory { 8 | bool BeginThread(SysThread &) ; 9 | virtual SysSemaphore *CreateNewSemaphore(int initialcount = 0, int maxcount = 0) ; 10 | } ; 11 | 12 | class W32SysSemaphore:public SysSemaphore { 13 | public: 14 | W32SysSemaphore(int initialcount = 0, int maxcount = 0) ; 15 | virtual ~W32SysSemaphore() ; 16 | virtual SysSemaphoreResult Wait() ; 17 | virtual SysSemaphoreResult TryWait() ; 18 | virtual SysSemaphoreResult WaitTimeout(unsigned long) ; 19 | virtual SysSemaphoreResult Post() ; 20 | private: 21 | HANDLE handle_ ; 22 | } ; 23 | #endif -------------------------------------------------------------------------------- /sources/Adapters/W32/Timer/W32Timer.h: -------------------------------------------------------------------------------- 1 | #ifndef _W32_TIMER_H_ 2 | #define _W32_TIMER_H_ 3 | 4 | #include "System/Timer/Timer.h" 5 | #include 6 | 7 | class W32Timer: public I_Timer { 8 | public: 9 | W32Timer() ; 10 | virtual ~W32Timer() ; 11 | virtual void SetPeriod(float msec) ; 12 | virtual bool Start() ; 13 | virtual void Stop() ; 14 | virtual float GetPeriod() ; 15 | void OnTimerTick() ; 16 | private: 17 | float period_ ; 18 | float offset_ ; // Float offset taking into account 19 | // period is an int 20 | MMRESULT timer_ ; // NULL if not running 21 | long lastTick_ ; 22 | bool running_ ; 23 | } ; 24 | 25 | class W32TimerService: public TimerService { 26 | public: 27 | virtual I_Timer *CreateTimer() ; // Returns a timer 28 | virtual void TriggerCallback(int msec,timerCallback cb) ; 29 | }; 30 | 31 | #endif -------------------------------------------------------------------------------- /sources/Adapters/W32FileSystem/W32FileSystem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _W32_FILESYSTEM_H_ 3 | #define _W32_FILESYSTEM_H_ 4 | 5 | #include "System/FileSystem/FileSystem.h" 6 | #include 7 | 8 | class W32File: public I_File { 9 | public: 10 | W32File(FILE *) ; 11 | virtual ~W32File() ; 12 | virtual int Read(void *ptr, int size, int nmemb) ; 13 | virtual int Write(const void *ptr, int size, int nmemb) ; 14 | virtual void Printf(const char *format,...); 15 | virtual void Seek(long offset,int whence) ; 16 | virtual long Tell() ; 17 | 18 | virtual void Close() ; 19 | private: 20 | FILE *file_ ; 21 | } ; 22 | 23 | class W32Dir: public I_Dir { 24 | public: 25 | W32Dir(const char *path) ; 26 | virtual ~W32Dir() {} ; 27 | virtual void GetContent(char *mask) ; 28 | } ; 29 | 30 | class W32FileSystem: public FileSystem { 31 | public: 32 | virtual I_File *Open(const char *path,char *mode); 33 | virtual I_Dir *Open(const char *path) ; 34 | virtual FileType GetFileType(const char *path) ; 35 | virtual Result MakeDir(const char *path) ; 36 | virtual void Delete(const char *path) ; 37 | } ; 38 | #endif 39 | -------------------------------------------------------------------------------- /sources/Adapters/WSDLSystem/WSDLSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef _WSDL_SYSTEM_H_ 2 | #define _WSDL_SYSTEM_H_ 3 | 4 | #include "System/System/System.h" 5 | #include "Externals/SDL/SDL.h" 6 | #include 7 | #include "UIFramework/SimpleBaseClasses/EventManager.h" 8 | 9 | class WSDLSystem: public System { 10 | public: 11 | static void Boot(int argc,char **argv) ; 12 | static void Shutdown() ; 13 | static int MainLoop() ; 14 | 15 | public: // System implementation 16 | virtual unsigned long GetClock() ; 17 | virtual void Sleep(int millisec); 18 | virtual void *Malloc(unsigned size) ; 19 | virtual void Free(void *) ; 20 | virtual void Memset(void *addr,char val,int size) ; 21 | virtual void *Memcpy(void *s1, const void *s2, int n) ; 22 | virtual int GetBatteryLevel() { return -1 ; } ; 23 | virtual void PostQuitMessage() ; 24 | virtual unsigned int GetMemoryUsage() ; 25 | 26 | static std::string SGetLastErrorString(); 27 | 28 | private: 29 | static EventManager *eventManager_; 30 | 31 | } ; 32 | #endif 33 | -------------------------------------------------------------------------------- /sources/Adapters/WSDLUI/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "WSDLGUIWindowImp.h" 3 | 4 | 5 | GUIFactory::GUIFactory() { 6 | } ; 7 | 8 | 9 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 10 | return *(new WSDLGUIWindowImp(p)) ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Adapters/WSDLUI/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_GUI_FACTORY_H_ 2 | #define WIN32_GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory: public I_GUIWindowFactory { 7 | 8 | 9 | 10 | public: 11 | 12 | GUIFactory() ; 13 | 14 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; 15 | 16 | } ; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Application/Application.h: -------------------------------------------------------------------------------- 1 | #ifndef _APPLICATION_H_ 2 | #define _APPLICATION_H_ 3 | 4 | #include "UIFramework/SimpleBaseClasses/GUIWindow.h" 5 | #include "Foundation/T_Singleton.h" 6 | 7 | class Application:public T_Singleton { 8 | 9 | public: 10 | Application() ; 11 | ~Application() ; 12 | bool Init(GUICreateWindowParams ¶ms) ; 13 | 14 | GUIWindow *GetWindow() ; 15 | protected: 16 | void initMidiInput(); 17 | 18 | private: 19 | GUIWindow *window_ ; 20 | private: 21 | static Application* instance_ ; 22 | } ; 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /sources/Application/Audio/AudioFileStreamer.h: -------------------------------------------------------------------------------- 1 | #ifndef _AUDIO_FILE_STREAMER_H_ 2 | #define _AUDIO_FILE_STREAMER_H_ 3 | 4 | #include "Services/Audio/AudioModule.h" 5 | #include "System/FileSystem/FileSystem.h" 6 | #include "Application/Instruments/WavFile.h" 7 | 8 | enum AudioFileStreamerMode { 9 | AFSM_STOPPED, 10 | AFSM_PLAYING 11 | } ; 12 | 13 | class AudioFileStreamer: public AudioModule { 14 | public: 15 | AudioFileStreamer() ; 16 | virtual ~AudioFileStreamer() ; 17 | virtual bool Render(fixed *buffer,int samplecount) ; 18 | bool Start(const Path &) ; 19 | void Stop() ; 20 | protected: 21 | AudioFileStreamerMode mode_ ; 22 | Path path_ ; 23 | bool newPath_ ; 24 | WavFile *wav_ ; 25 | int position_ ; 26 | int shift_ ; 27 | } ; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sources/Application/Commands/ApplicationCommandDispatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef _APPLICATION_COMMAND_DISPATCHER_H_ 2 | #define _APPLICATION_COMMAND_DISPATCHER_H_ 3 | 4 | #include "CommandDispatcher.h" 5 | #include "Foundation/T_Singleton.h" 6 | #include "Application/Model/Project.h" 7 | 8 | class ApplicationCommandDispatcher: public T_Singleton,public CommandExecuter { 9 | public: 10 | ApplicationCommandDispatcher() ; 11 | ~ApplicationCommandDispatcher() ; 12 | void Init(Project *project) ; 13 | void Close() ; 14 | virtual void Execute(FourCC id,float value) ; 15 | void OnTempoTap() ; 16 | void OnQueueRow() ; 17 | void OnNudgeDown() ; 18 | void OnNudgeUp() ; 19 | private: 20 | Project *project_ ; 21 | } ; 22 | 23 | #endif -------------------------------------------------------------------------------- /sources/Application/Commands/EventDispatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef _EVENT_DISPATCHER_H_ 2 | #define _EVENT_DISPATCHER_H_ 3 | 4 | #include "CommandDispatcher.h" 5 | #include "Foundation/T_Singleton.h" 6 | #include "Application/AppWindow.h" 7 | #include "System/Timer/Timer.h" 8 | #include "Foundation/Observable.h" 9 | 10 | class EventDispatcher: public T_Singleton,public CommandExecuter,public I_Observer { 11 | public: 12 | EventDispatcher() ; 13 | ~EventDispatcher() ; 14 | void SetWindow(GUIWindow *window) ; 15 | virtual void Execute(FourCC id,float value) ; 16 | unsigned int OnTimerTick() ; 17 | int GetEventMask() { return eventMask_ ; } ; 18 | virtual void Update(Observable &o,I_ObservableData *d) ; 19 | private: 20 | GUIWindow *window_ ; 21 | static int keyRepeat_ ; 22 | static int keyDelay_ ; 23 | unsigned int eventMask_ ; 24 | unsigned int repeatMask_ ; 25 | I_Timer *timer_ ; 26 | } ; 27 | 28 | #endif -------------------------------------------------------------------------------- /sources/Application/Controllers/ControlRoom.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONTROLROOM_H_ 3 | #define _CONTROLROOM_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "Services/Controllers/ControlNode.h" 7 | 8 | 9 | class ControlRoom:public T_Singleton,public ControlNode { 10 | public: 11 | ControlRoom() ; 12 | ~ControlRoom() ; 13 | 14 | bool Init() ; 15 | void Close() ; 16 | 17 | bool Attach(const char *nodeUrl,const char *controllerUrl) ; 18 | AssignableControlNode *GetControlNode(const std::string url) ; 19 | 20 | bool LoadMapping(const char *path) ; 21 | 22 | void Dump() ; 23 | } ; 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Application/Instruments/I_SRPUpdater.h: -------------------------------------------------------------------------------- 1 | #ifndef _I_SRP_UPDATER_H_ 2 | #define _I_SRP_UPDATER_H_ 3 | 4 | #include "Application/Utils/fixed.h" 5 | 6 | struct RUParams { 7 | fixed volumeOffset_ ; 8 | fixed speedOffset_ ; 9 | fixed cutOffset_ ; 10 | fixed resOffset_ ; 11 | fixed panOffset_ ; 12 | fixed fbMixOffset_ ; 13 | fixed fbTunOffset_ ; 14 | } ; 15 | 16 | class I_SRPUpdater { 17 | public: 18 | I_SRPUpdater() {} ; 19 | virtual ~I_SRPUpdater() {} ; 20 | virtual void Trigger(bool tableTick)=0 ; 21 | virtual void UpdateSRP(struct RUParams &rup)=0 ; 22 | void Enable() { enabled_=true ;} ; 23 | void Disable() { enabled_=false ;} ; 24 | bool Enabled() { return enabled_ ; } ; 25 | protected: 26 | bool enabled_ ; 27 | } ; 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Application/Instruments/InstrumentBank.h: -------------------------------------------------------------------------------- 1 | #ifndef _INSTRUMENT_BANK_H_ 2 | #define _INSTRUMENT_BANK_H_ 3 | 4 | #include "Application/Persistency/Persistent.h" 5 | #include "Application/Model/Song.h" 6 | #include "Application/Instruments/I_Instrument.h" 7 | 8 | #define NO_MORE_INSTRUMENT 0x100 9 | 10 | class InstrumentBank: public Persistent { 11 | public: 12 | InstrumentBank() ; 13 | ~InstrumentBank() ; 14 | void AssignDefaults() ; 15 | I_Instrument *GetInstrument(int i) ; 16 | virtual void SaveContent(TiXmlNode *node); 17 | virtual void RestoreContent(TiXmlElement *element); 18 | void Init() ; 19 | void OnStart() ; 20 | unsigned short GetNext() ; 21 | unsigned short Clone(unsigned short i) ; 22 | private: 23 | I_Instrument *instrument_[MAX_INSTRUMENT_COUNT] ; 24 | } ; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SamplePool.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SAMPLE_POOL_H_ 3 | #define _SAMPLE_POOL_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "WavFile.h" 7 | #include "Application/Model/Song.h" 8 | #include "Foundation/Observable.h" 9 | 10 | #define MAX_PIG_SAMPLES MAX_SAMPLEINSTRUMENT_COUNT 11 | 12 | enum SamplePoolEventType { 13 | SPET_INSERT, 14 | SPET_DELETE 15 | } ; 16 | 17 | struct SamplePoolEvent: public I_ObservableData { 18 | SamplePoolEventType type_ ; 19 | int index_ ; 20 | } ; 21 | 22 | class SamplePool: public T_Singleton,public Observable { 23 | public: 24 | void Load() ; 25 | SamplePool() ; 26 | void Reset() ; 27 | ~SamplePool() ; 28 | SoundSource *GetSource(int i) ; 29 | char **GetNameList() ; 30 | int GetNameListSize(); 31 | int ImportSample(Path &path) ; 32 | void PurgeSample(int i) ; 33 | const char *GetSampleLib() ; 34 | protected: 35 | bool loadSample(const char * path) ; 36 | bool loadSoundFont(const char *path); 37 | int count_ ; 38 | char* names_[MAX_PIG_SAMPLES] ; 39 | SoundSource *wav_[MAX_PIG_SAMPLES] ; 40 | } ; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SampleVariable.cpp: -------------------------------------------------------------------------------- 1 | #include "SampleVariable.h" 2 | #include "SamplePool.h" 3 | 4 | SampleVariable::SampleVariable(const char *name,FourCC id):WatchedVariable(name,id,0,0,-1) { 5 | SamplePool *pool=SamplePool::GetInstance() ; 6 | list_.char_=pool->GetNameList() ; 7 | listSize_=pool->GetNameListSize() ; 8 | pool->AddObserver(*this) ; 9 | } ; 10 | 11 | SampleVariable::~SampleVariable() { 12 | SamplePool *pool=SamplePool::GetInstance() ; 13 | pool->RemoveObserver(*this) ; 14 | } ; 15 | 16 | void SampleVariable::Update(Observable &o,I_ObservableData *d) { 17 | SamplePoolEvent *e=(SamplePoolEvent *)d ; 18 | // if we recieved notification that an element has been removed 19 | // we shift down all the index above the removed element 20 | if (e->type_==SPET_DELETE) { 21 | NAssert(e->index_!=value_.index_) ; 22 | if (value_.index_>e->index_) { 23 | value_.index_-- ; 24 | } ; 25 | } ; 26 | SamplePool *pool=(SamplePool*)&o ; 27 | list_.char_=pool->GetNameList() ; 28 | listSize_=pool->GetNameListSize() ; 29 | } ; 30 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SampleVariable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SAMPLE_VARIABLE_H_ 3 | #define _SAMPLE_VARIABLE_H_ 4 | 5 | #include "Foundation/Variables/WatchedVariable.h" 6 | #include "Foundation/Observable.h" 7 | 8 | class SampleVariable:public WatchedVariable,public I_Observer { 9 | public: 10 | SampleVariable(const char *name,FourCC id) ; 11 | ~SampleVariable() ; 12 | protected: 13 | virtual void Update(Observable &o,I_ObservableData *d) ; 14 | 15 | } ; 16 | #endif -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundFontManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOUND_FONT_MANAGER_H_ 2 | #define _SOUND_FONT_MANAGER_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "Externals/Soundfont/ENAB.H" 6 | #include 7 | 8 | class SoundFontManager:public T_Singleton { 9 | public: 10 | SoundFontManager() ; 11 | ~SoundFontManager() ; 12 | void Reset() ; 13 | sfBankID LoadBank(const char *path) ; 14 | private: 15 | std::vector sampleData_ ; 16 | }; 17 | #endif 18 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundFontPreset.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOUNDFONT_PRESET_H_ 2 | #define _SOUNDFONT_PRESET_H_ 3 | 4 | #include "SoundSource.h" 5 | #include "Externals/Soundfont/SFNAV.H" 6 | #include "Externals/Soundfont/ENAB.H" 7 | 8 | class SoundFontPreset: public SoundSource { 9 | public: 10 | SoundFontPreset(int sfID,int presetID) ; 11 | virtual ~SoundFontPreset() ; 12 | virtual int GetSize(int note) ; 13 | virtual int GetSampleRate(int note) ; 14 | virtual int GetChannelCount(int note) ; 15 | virtual void *GetSampleBuffer(int note) ; 16 | virtual bool IsMulti() ; 17 | virtual int GetRootNote(int note) ; 18 | virtual int GetLoopStart(int note) ; 19 | virtual int GetLoopEnd(int note) ; 20 | 21 | bool IsLooped(int loop) ; 22 | 23 | protected: 24 | 25 | void checkNote(int note) ; 26 | private: 27 | SoundFontNavigator navigator_ ; 28 | sfData *vect_ ; 29 | int sfID_ ; 30 | int presetID_ ; 31 | int lastNote_ ; 32 | } ; 33 | #endif 34 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundFontSample.cpp: -------------------------------------------------------------------------------- 1 | #include "SoundFontSample.h" 2 | 3 | SoundFontSample::SoundFontSample(sfSampleHdr &header):sfHeader_(header) { 4 | } 5 | 6 | SoundFontSample::~SoundFontSample() { 7 | } 8 | 9 | void *SoundFontSample::GetSampleBuffer(int note) { 10 | return (void *)sfHeader_.dwStart ; 11 | } 12 | 13 | int SoundFontSample::GetChannelCount(int note) { 14 | return 1; 15 | } ; 16 | 17 | int SoundFontSample::GetSampleRate(int note) { 18 | return sfHeader_.dwSampleRate ; 19 | } ; 20 | 21 | int SoundFontSample::GetSize(int note){ 22 | return sfHeader_.dwEnd ; 23 | } ; 24 | 25 | int SoundFontSample::GetRootNote(int note) { 26 | return sfHeader_.byOriginalKey ; 27 | } ; 28 | 29 | int SoundFontSample::GetLoopStart(int note) { 30 | return sfHeader_.dwStartloop ; 31 | } ; 32 | 33 | int SoundFontSample::GetLoopEnd(int note) { 34 | return sfHeader_.dwEndloop ; 35 | } ; -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundFontSample.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOUND_FONT_SAMPLE_H_ 2 | #define _SOUND_FONT_SAMPLE_H_ 3 | 4 | #include "SoundSource.h" 5 | #include "System/FileSystem/FileSystem.h" 6 | #include "Externals/Soundfont/ENAB.H" 7 | 8 | class SoundFontSample: public SoundSource { 9 | public: 10 | // From,to in bytes 11 | SoundFontSample(sfSampleHdr &header) ; 12 | virtual ~SoundFontSample() ; 13 | virtual int GetSize(int note) ; 14 | virtual int GetSampleRate(int note) ; 15 | virtual int GetChannelCount(int note) ; 16 | virtual void *GetSampleBuffer(int note) ; 17 | virtual bool IsMulti() {return false ; } ; 18 | virtual int GetRootNote(int note) ; 19 | virtual int GetLoopStart(int note) ; 20 | virtual int GetLoopEnd(int note) ; 21 | 22 | private: 23 | sfSampleHdr sfHeader_ ; 24 | } ; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundSource.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/sources/Application/Instruments/SoundSource.cpp -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundSource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOUND_SOURCE_H_ 2 | #define _SOUND_SOURCE_H_ 3 | 4 | class SoundSource { 5 | public: 6 | SoundSource() {} ; 7 | virtual ~SoundSource() {} ; 8 | virtual int GetLoopStart(int note) { return -1 ; } ; 9 | virtual int GetLoopEnd(int note) { return -1 ; } ; 10 | virtual int GetSize(int note)=0 ; 11 | virtual int GetSampleRate(int note)=0 ; 12 | virtual int GetChannelCount(int note)=0 ; 13 | virtual void *GetSampleBuffer(int note)=0 ; 14 | virtual bool IsMulti()=0 ; 15 | virtual int GetRootNote(int note)=0 ; 16 | } ; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Application/Instruments/WavFileWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _WAV_FILE_WRITER_H_ 2 | #define _WAV_FILE_WRITER_H_ 3 | 4 | #include "System/FileSystem/FileSystem.h" 5 | #include "Application/Utils/fixed.h" 6 | 7 | class WavFileWriter { 8 | public: 9 | WavFileWriter(const char *path) ; 10 | ~WavFileWriter() ; 11 | void AddBuffer(fixed *,int size) ; // size in samples 12 | void Close() ; 13 | private: 14 | int sampleCount_ ; 15 | short *buffer_ ; 16 | int bufferSize_ ; 17 | I_File *file_ ; 18 | } ; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Application/Mixer/MixBus.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "MixBus.h" 3 | -------------------------------------------------------------------------------- /sources/Application/Mixer/MixBus.h: -------------------------------------------------------------------------------- 1 | #ifndef _MIX_BUS_H_ 2 | #define _MIX_BUS_H_ 3 | 4 | #include "Services/Audio/AudioMixer.h" 5 | 6 | class MixBus: public AudioMixer { 7 | public: 8 | MixBus():AudioMixer("bus") {} ; 9 | virtual ~MixBus() {} ; 10 | } ; 11 | #endif 12 | -------------------------------------------------------------------------------- /sources/Application/Model/Chain.cpp: -------------------------------------------------------------------------------- 1 | #include "Chain.h" 2 | #include "System/System/System.h" 3 | #include 4 | #include 5 | 6 | Chain::Chain() { 7 | 8 | int size=CHAIN_COUNT*16 ; 9 | data_=(unsigned char *)SYS_MALLOC(size) ; 10 | memset(data_,0xFF,size) ; 11 | transpose_=(unsigned char *)SYS_MALLOC(size) ; 12 | memset(transpose_,0x00,size) ; 13 | for (int i=0;i,public VariableContainer { 10 | public: 11 | Config() ; 12 | ~Config() ; 13 | const char *GetValue(const char *key) ; 14 | void ProcessArguments(int argc,char **argv) ; 15 | } ; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /sources/Application/Model/Groove.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GROOVE_H_ 3 | #define _GROOVE_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "Application/Persistency/Persistent.h" 7 | #include "Application/Model/Song.h" 8 | #include "Application/Utils/HexBuffers.h" 9 | 10 | #define MAX_GROOVES 0x20 11 | #define NO_GROOVE_DATA 0xFF 12 | 13 | struct ChannelGroove { 14 | unsigned char groove_ ; // selected groove 15 | unsigned char position_ ; // step in the groove table 16 | unsigned char ticks_ ; // number of ticks before next step 17 | 18 | } ; 19 | 20 | class Groove:public T_Singleton,Persistent { 21 | public: 22 | Groove() ; 23 | ~Groove() ; 24 | void Reset() ; 25 | void Clear() ; 26 | void Trigger() ; 27 | bool TriggerChannel(int channel) ; 28 | void SetGroove(int channel,int groove) ; 29 | bool UpdateGroove(ChannelGroove &g,bool reverse) ; 30 | void GetChannelData(int channel,int *groove,int *position) ; 31 | unsigned char *GetGrooveData(int groove) ; 32 | virtual void SaveContent(TiXmlNode *node) ; 33 | virtual void RestoreContent(TiXmlElement *element); 34 | 35 | private: 36 | ChannelGroove channelGroove_[SONG_CHANNEL_COUNT] ; 37 | static unsigned char data_[MAX_GROOVES][16] ; 38 | } ; 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /sources/Application/Model/Mixer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Mixer.h" 3 | 4 | Mixer::Mixer():Persistent("MIXER") { 5 | Clear() ; 6 | } ; 7 | 8 | Mixer::~Mixer() { 9 | } ; 10 | 11 | void Mixer::Clear() { 12 | 13 | for (int i=0;i,Persistent { 12 | public: 13 | Mixer() ; 14 | ~Mixer() ; 15 | void Clear() ; 16 | 17 | inline int GetBus(int i) { return channelBus_[i] ; } ; 18 | 19 | virtual void SaveContent(TiXmlNode *node) ; 20 | virtual void RestoreContent(TiXmlElement *element); 21 | private: 22 | char channelBus_[SONG_CHANNEL_COUNT] ; 23 | } ; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Application/Model/Phrase.h: -------------------------------------------------------------------------------- 1 | #ifndef _PHRASE_H_ 2 | #define _PHRASE_H_ 3 | 4 | #include "Foundation/Types/Types.h" 5 | #define PHRASE_COUNT 0xFF 6 | #define NO_MORE_PHRASE 0x100 7 | 8 | class Phrase { 9 | public: 10 | Phrase() ; 11 | ~Phrase() ; 12 | unsigned short GetNext() ; 13 | bool IsUsed(uchar i) { return isUsed_[i] ; } ; 14 | void SetUsed(uchar c) ; 15 | void ClearAllocation() ; 16 | 17 | uchar *note_ ; 18 | uchar *instr_ ; 19 | FourCC *cmd1_ ; 20 | ushort *param1_ ; 21 | FourCC *cmd2_ ; 22 | ushort *param2_ ; 23 | 24 | private: 25 | bool isUsed_[PHRASE_COUNT] ; 26 | 27 | } ; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sources/Application/Model/Song.h: -------------------------------------------------------------------------------- 1 | #ifndef _SONG_H_ 2 | #define _SONG_H_ 3 | 4 | #include "Chain.h" 5 | #include "Phrase.h" 6 | #include "Application/Persistency/Persistent.h" 7 | 8 | #define SONG_CHANNEL_COUNT 8 9 | #define SONG_ROW_COUNT 256 10 | 11 | #define MAX_SAMPLEINSTRUMENT_COUNT 0x80 12 | #define MAX_MIDIINSTRUMENT_COUNT 0x10 13 | 14 | #define MAX_INSTRUMENT_COUNT (MAX_SAMPLEINSTRUMENT_COUNT+MAX_MIDIINSTRUMENT_COUNT) 15 | 16 | class Song:Persistent { 17 | public: 18 | Song() ; 19 | ~Song() ; 20 | 21 | virtual void SaveContent(TiXmlNode *node) ; 22 | virtual void RestoreContent(TiXmlElement *element); 23 | 24 | unsigned char *data_ ; 25 | Chain *chain_ ; 26 | Phrase *phrase_ ; 27 | } ; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sources/Application/Model/Table.h: -------------------------------------------------------------------------------- 1 | #ifndef _TABLE_H_ 2 | #define _TABLE_H_ 3 | 4 | #include "Foundation/Types/Types.h" 5 | #include "Foundation/T_Singleton.h" 6 | #include "Application/Persistency/Persistent.h" 7 | 8 | #define TABLE_COUNT 0x80 9 | #define TABLE_STEPS 16 10 | 11 | #define NO_MORE_TABLE TABLE_COUNT+10 12 | 13 | 14 | class Table { 15 | public: 16 | Table() ; 17 | void Reset() ; 18 | bool IsEmpty() ; 19 | void Copy(const Table &other) ; 20 | public: 21 | FourCC cmd1_[TABLE_STEPS] ; 22 | ushort param1_[TABLE_STEPS] ; 23 | FourCC cmd2_[TABLE_STEPS] ; 24 | ushort param2_[TABLE_STEPS] ; 25 | FourCC cmd3_[TABLE_STEPS] ; 26 | ushort param3_[TABLE_STEPS] ; 27 | } ; 28 | 29 | class TableHolder: public T_Singleton,Persistent { 30 | public: 31 | TableHolder() ; 32 | void Reset() ; 33 | Table &GetTable(int table) ; 34 | void SetUsed(int table) ; 35 | int GetNext() ; 36 | int Clone(int table) ; 37 | virtual void SaveContent(TiXmlNode *node) ; 38 | virtual void RestoreContent(TiXmlElement *element); 39 | 40 | private: 41 | Table table_[TABLE_COUNT] ; 42 | bool allocation_[TABLE_COUNT] ; 43 | } ; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /sources/Application/Persistency/PersistencyService.h: -------------------------------------------------------------------------------- 1 | #ifndef _PERSISTENCY_SERVICE_H_ 2 | #define _PERSISTENCY_SERVICE_H_ 3 | 4 | #include "Foundation/Services/Service.h" 5 | #include "Foundation/T_Singleton.h" 6 | #include "Externals/TinyXML/tinyxml.h" 7 | 8 | class PersistencyService: public Service,public T_Singleton { 9 | public: 10 | PersistencyService() ; 11 | void Save() ; 12 | bool Load() ; 13 | } ; 14 | 15 | class PersistencyDocument: public TiXmlDocument { 16 | public: 17 | PersistencyDocument(const char *filename):TiXmlDocument(filename) { version_=0 ;} ; 18 | PersistencyDocument(const std::string& filename):TiXmlDocument(filename) { version_=0 ;} ; 19 | int version_ ; 20 | } ; 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Application/Persistency/Persistent.cpp: -------------------------------------------------------------------------------- 1 | #include "Persistent.h" 2 | #include "Foundation/Types/Types.h" 3 | 4 | Persistent::Persistent(const char *nodeName):SubService(MAKE_FOURCC('S','V','P','S')) { 5 | nodeName_=nodeName ; 6 | } ; 7 | 8 | void Persistent::Save(TiXmlNode *node) { 9 | TiXmlElement master(nodeName_) ; 10 | TiXmlNode *first=node->InsertEndChild(master) ; 11 | SaveContent(first) ; 12 | } ; 13 | 14 | bool Persistent::Restore(TiXmlElement *element) { 15 | if (!strcmp(element->Value(),nodeName_)) { 16 | RestoreContent(element) ; 17 | return true ; 18 | } 19 | return false ; 20 | } ; 21 | -------------------------------------------------------------------------------- /sources/Application/Persistency/Persistent.h: -------------------------------------------------------------------------------- 1 | #ifndef _PERSISTENT_H_ 2 | #define _PERSISTENT_H_ 3 | 4 | #include "Foundation/Services/SubService.h" 5 | #include "Externals/TinyXML/tinyxml.h" 6 | 7 | class Persistent:SubService { 8 | public: 9 | Persistent(const char *nodeName) ; 10 | void Save(TiXmlNode *node) ; 11 | bool Restore(TiXmlElement *element) ; 12 | protected: 13 | virtual void SaveContent(TiXmlNode *node)=0 ; 14 | virtual void RestoreContent(TiXmlElement *element)=0 ; 15 | private: 16 | const char *nodeName_ ; 17 | } ; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Application/Player/PlayerChannel.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PLAYER_CHANNEL_H_ 3 | #define _PLAYER_CHANNEL_H_ 4 | 5 | #include "Services/Audio/AudioModule.h" 6 | #include "Application/Instruments/I_Instrument.h" 7 | #include "Application/Mixer/MixBus.h" 8 | 9 | class PlayerChannel: public AudioModule { 10 | public: 11 | PlayerChannel(int index) ; 12 | virtual ~PlayerChannel() ; 13 | virtual bool Render(fixed *buffer,int samplecount) ; 14 | void StartInstrument(I_Instrument *instr,unsigned char note,bool cleanStart) ; 15 | void StopInstrument() ; 16 | I_Instrument *GetInstrument() ; 17 | void SetMute(bool muted) ; 18 | bool IsMuted() ; 19 | void SetMixBus(int i) ; 20 | void Reset() ; 21 | private: 22 | int index_ ; 23 | I_Instrument *instr_ ; 24 | bool muted_ ; 25 | int busIndex_ ; 26 | MixBus *mixBus_ ; 27 | } ; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sources/Application/Player/SyncMaster.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYNC_MASTER_H_ 2 | #define _SYNC_MASTER_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | 6 | // Provide basic functionalities to compute various 7 | // setting regarding tempo, buffer sizes, ticks 8 | 9 | class SyncMaster: public T_Singleton { 10 | public: 11 | SyncMaster() ; 12 | void Start() ; 13 | void Stop() ; 14 | void SetTempo(int tempo) ; 15 | int GetTempo() ; 16 | void NextSlice() ; 17 | bool MajorSlice() ; 18 | bool TableSlice() ; 19 | bool MidiSlice() ; 20 | float GetPlaySampleCount() ; 21 | float GetTickSampleCount() ; 22 | int GetTableRatio() ; 23 | void SetTableRatio(int ratio) ; 24 | unsigned int GetBeatCount() ; 25 | float GetTickTime() ; 26 | private: 27 | int tempo_ ; 28 | int currentSlice_ ; 29 | int tableRatio_ ; 30 | unsigned int beatCount_ ; 31 | float playSampleCount_ ; 32 | float tickSampleCount_ ; 33 | 34 | } ; 35 | #endif 36 | -------------------------------------------------------------------------------- /sources/Application/Utils/HexBuffers.h: -------------------------------------------------------------------------------- 1 | #ifndef _HEX_BUFFERS_H_ 2 | #define _HEX_BUFFERS_H_ 3 | 4 | #include "Externals/TinyXML/tinyxml.h" 5 | 6 | void saveHexBuffer(TiXmlNode *parent,const char *nodeName,unsigned char *src,unsigned len) ; 7 | void saveHexBuffer(TiXmlNode *parent,const char *nodeName,unsigned short *src,unsigned len) ; 8 | void saveHexBuffer(TiXmlNode *parent,const char *nodeName,unsigned int *src,unsigned len) ; 9 | void restoreHexBuffer(TiXmlNode *node,unsigned char *dst) ; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /sources/Application/Utils/char.cpp: -------------------------------------------------------------------------------- 1 | #include "char.h" 2 | 3 | char h2c__[16]= {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' } ; 4 | 5 | const char *notes__[12] = { 6 | "C ","C#","D ","D#","E ","F ","F#","G ","G#","A ","A#","B " 7 | } ; 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sources/Application/Utils/fixed.cpp: -------------------------------------------------------------------------------- 1 | // fixed point numbers 2 | 3 | #include "fixed.h" 4 | 5 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/FieldView.h: -------------------------------------------------------------------------------- 1 | #ifndef _FIELD_VIEW_H_ 2 | #define _FIELD_VIEW_H_ 3 | 4 | #include "View.h" 5 | #include "Foundation/T_SimpleList.h" 6 | #include "UIField.h" 7 | 8 | class FieldView: public View,public T_SimpleList { 9 | public: 10 | FieldView(GUIWindow &w,ViewData *viewData) ; 11 | 12 | virtual void Redraw() ; 13 | virtual void ProcessButtonMask(unsigned short mask) ; 14 | 15 | void SetFocus(UIField *) ; 16 | UIField *GetFocus() ; 17 | void ClearFocus() ; 18 | int GetFocusIndex() ; 19 | void SetSize(int size) ; 20 | private: 21 | T_SimpleList fieldList_ ; 22 | UIField *focus_ ; 23 | } ; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/I_Action.cpp: -------------------------------------------------------------------------------- 1 | #include "I_Action.h" 2 | 3 | I_Action::I_Action(char *name) { 4 | name_=name ; 5 | } ; 6 | 7 | I_Action::~I_Action() { 8 | } ; 9 | 10 | char *I_Action::GetName() { 11 | return name_ ; 12 | } ; 13 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/I_Action.h: -------------------------------------------------------------------------------- 1 | #ifndef _I_ACTION_H_ 2 | #define _I_ACTION_H_ 3 | 4 | class I_Action { 5 | public: 6 | I_Action(char *name); 7 | virtual ~I_Action() ; 8 | char *GetName() ; 9 | virtual void Do()=0 ; 10 | private: 11 | char *name_ ; 12 | } ; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/ModalView.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MODAL_VIEW_H_ 3 | #define _MODAL_VIEW_H_ 4 | 5 | #include "View.h" 6 | 7 | class ModalView: public View { 8 | public: 9 | ModalView(View &) ; 10 | virtual ~ModalView() ; 11 | 12 | bool IsFinished() ; 13 | int GetReturnCode() ; 14 | 15 | protected: 16 | void SetWindow(int width,int height) ; 17 | virtual void ClearRect(int x,int y,int w,int h) ; 18 | virtual void DrawString(int x,int y,const char *txt,GUITextProperties &props) ; 19 | void EndModal(int returnCode) ; 20 | private: 21 | bool finished_ ; 22 | int returnCode_ ; 23 | int left_ ; 24 | int top_ ; 25 | } ; 26 | #endif -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIActionField.cpp: -------------------------------------------------------------------------------- 1 | #include "UIActionField.h" 2 | #include "Application/AppWindow.h" 3 | 4 | UIActionField::UIActionField(const char *name,unsigned int fourcc,GUIPoint &position):UIField(position) { 5 | name_=name ; 6 | fourcc_=fourcc ; 7 | } ; 8 | 9 | UIActionField::UIActionField(std::string name,unsigned int fourcc,GUIPoint &position):UIField(position) { 10 | name_=name ; 11 | fourcc_=fourcc ; 12 | } ; 13 | 14 | UIActionField::~UIActionField() { 15 | 16 | } ; 17 | void UIActionField::Draw(GUIWindow &w, int offset) { 18 | 19 | GUITextProperties props ; 20 | GUIPoint position(x_,y_+offset) ; 21 | 22 | if (focus_) { 23 | ((AppWindow&)w).SetColor(CD_HILITE2) ; 24 | props.invert_=true ; 25 | } else { 26 | ((AppWindow&)w).SetColor(CD_NORMAL) ; 27 | } 28 | 29 | w.DrawString(name_.c_str(),position,props) ; 30 | } ; 31 | 32 | void UIActionField::OnClick() { 33 | SetChanged() ; 34 | NotifyObservers((I_ObservableData *)fourcc_) ; 35 | } ; 36 | 37 | const char *UIActionField::GetString() { 38 | return name_.c_str() ; 39 | } ; 40 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIActionField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_ACTION_FIELD_ 2 | #define _UI_ACTION_FIELD_ 3 | 4 | #include "UIField.h" 5 | #include "Foundation/Observable.h" 6 | 7 | class UIActionField: public UIField,public Observable { 8 | public: 9 | UIActionField(const char *name,unsigned int fourcc,GUIPoint &position) ; 10 | UIActionField(std::string name,unsigned int fourcc,GUIPoint &position) ; 11 | virtual ~UIActionField() ; 12 | virtual void Draw(GUIWindow &w,int offset=0) ; 13 | virtual void ProcessArrow(unsigned short mask) {} ; 14 | virtual void OnClick() ; 15 | const char *GetString() ; 16 | 17 | protected: 18 | std::string name_ ; 19 | unsigned int fourcc_ ; 20 | } ; 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIBigHexVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_BIG_HEX_VAR_FIELD_H_ 2 | #define _UI_BIG_HEX_VAR_FIELD_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UIBigHexVarField: public UIIntVarField { 7 | 8 | public: 9 | 10 | UIBigHexVarField(GUIPoint &position,Variable &v,int precision,const char *format,int min,int max,int power,bool wrap=false) ; 11 | virtual ~UIBigHexVarField() {} ; 12 | virtual void Draw(GUIWindow &w,int offset=0) ; 13 | virtual void ProcessArrow(unsigned short mask) ; 14 | private: 15 | unsigned int precision_ ; 16 | unsigned int power_ ; 17 | unsigned int position_ ; 18 | bool wrap_ ; 19 | }; 20 | #endif 21 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIField.cpp: -------------------------------------------------------------------------------- 1 | #include "UIField.h" 2 | 3 | UIField::UIField(GUIPoint &position) { 4 | x_=position._x ; 5 | y_=position._y ; 6 | focus_=false ; 7 | } ; 8 | 9 | UIField::~UIField() { 10 | } ; 11 | 12 | GUIPoint UIField::GetPosition() { 13 | GUIPoint point (x_,y_) ; 14 | return point; 15 | } 16 | 17 | void UIField::SetPosition(GUIPoint &p) { 18 | x_=p._x ; 19 | y_=p._y ; 20 | } ; 21 | 22 | void UIField::ClearFocus() { 23 | focus_=false ; 24 | } ; 25 | 26 | void UIField::SetFocus() { 27 | focus_=true ; 28 | } ; 29 | 30 | bool UIField::HasFocus() { 31 | return focus_; 32 | } ; 33 | 34 | bool UIField::IsStatic() { 35 | return false ; 36 | } ; 37 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_FIELD_H_ 2 | #define _UI_FIELD_H_ 3 | 4 | #include "UIFramework/BasicDatas/GUIPoint.h" 5 | #include "UIFramework/SimpleBaseClasses/GUIWindow.h" 6 | #include "View.h" 7 | #include "System/Console/Trace.h" 8 | 9 | class UIField { 10 | public: 11 | UIField(GUIPoint &position) ; 12 | virtual ~UIField() ; 13 | virtual void Draw(GUIWindow &w,int offset=0)=0 ; 14 | virtual void OnClick()=0 ; // A depressed 15 | virtual void ProcessArrow(unsigned short mask)=0 ; 16 | virtual void OnBClick() {} ; // B depressed 17 | virtual void ProcessBArrow(unsigned short mask) {} ; 18 | void SetFocus() ; 19 | void ClearFocus() ; 20 | bool HasFocus() ; 21 | void SetPosition(GUIPoint &) ; 22 | GUIPoint GetPosition() ; 23 | GUIColor GetColor() ; 24 | 25 | virtual bool IsStatic() ; 26 | 27 | protected: 28 | int x_ ; 29 | int y_ ; 30 | bool focus_ ; 31 | } ; 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIIntField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_INT_FIELD_H_ 2 | #define _UI_INT_FIELD_H_ 3 | 4 | #include "UIField.h" 5 | 6 | class UIIntField: public UIField { 7 | 8 | public: 9 | 10 | UIIntField(GUIPoint &position,int *src,const char *format,int min,int max,int xOffset,int yOffset) ; 11 | virtual ~UIIntField() {} ; 12 | virtual void Draw(GUIWindow &w) ; 13 | virtual void ProcessArrow(unsigned short mask) ; 14 | virtual void OnClick() {} ; 15 | protected: 16 | 17 | protected: 18 | int *src_ ; 19 | const char *format_ ; 20 | int min_ ; 21 | int max_ ; 22 | int xOffset_ ; 23 | int yOffset_ ; 24 | 25 | } ; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIIntVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_INT_VAR_FIELD_H_ 2 | #define _UI_INT_VAR_FIELD_H_ 3 | 4 | #include "UIField.h" 5 | #include "Foundation/Variables/Variable.h" 6 | 7 | class UIIntVarField: public UIField { 8 | 9 | public: 10 | 11 | UIIntVarField( 12 | GUIPoint &position, 13 | Variable &v, 14 | const char *format, 15 | int min, 16 | int max, 17 | int xOffset, 18 | int yOffset, 19 | int displayOffset = 0); 20 | 21 | virtual ~UIIntVarField() {} ; 22 | virtual void Draw(GUIWindow &w,int offset=0) ; 23 | virtual void ProcessArrow(unsigned short mask) ; 24 | virtual void OnClick() {} ; 25 | 26 | FourCC GetVariableID() ; 27 | Variable &GetVariable() ; 28 | protected: 29 | Variable &src_ ; 30 | const char *format_ ; 31 | int min_ ; 32 | int max_ ; 33 | int xOffset_ ; 34 | int yOffset_ ; 35 | int displayOffset_; 36 | } ; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIIntVarOffField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_INT_VAR_OFF_FIELD_H_ 2 | #define _UI_INT_VAR_OFF_FIELD_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UIIntVarOffField:public UIIntVarField { 7 | public: 8 | UIIntVarOffField(GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset) ; 9 | virtual void ProcessArrow(unsigned short mask) ; 10 | virtual void Draw(GUIWindow &w,int offset=0) ; 11 | } ; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UINoteVarField.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "UINoteVarField.h" 3 | #include "Application/Utils/char.h" 4 | #include "Application/AppWindow.h" 5 | 6 | UINoteVarField::UINoteVarField(GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset) 7 | :UIIntVarField(position,v,format,min,max,xOffset,yOffset) { 8 | } ; 9 | 10 | void UINoteVarField::Draw(GUIWindow &w,int offset) { 11 | 12 | 13 | GUITextProperties props ; 14 | GUIPoint position=GetPosition() ; 15 | position._y+=offset ; 16 | 17 | if (focus_) { 18 | ((AppWindow&)w).SetColor(CD_HILITE2) ; 19 | props.invert_=true ; 20 | } else { 21 | ((AppWindow&)w).SetColor(CD_NORMAL) ; 22 | } 23 | 24 | char buffer[80] ; 25 | char note[5] ; 26 | 27 | unsigned char pitch=src_.GetInt() ; 28 | note2char(pitch,note) ; 29 | note[4]=0 ; 30 | sprintf(buffer,format_,note) ; 31 | w.DrawString(buffer,position,props) ; 32 | } ; 33 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UINoteVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_VAR_NOTE_FIELD_H_ 2 | #define _UI_VAR_NOTE_FIELD_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UINoteVarField: public UIIntVarField { 7 | 8 | public: 9 | UINoteVarField(GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset) ; 10 | virtual void Draw(GUIWindow &w,int offset=0) ; 11 | 12 | } ; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UISortedVarList.cpp: -------------------------------------------------------------------------------- 1 | #include "UISortedVarList.h" 2 | 3 | UISortedVarList::UISortedVarList(GUIPoint &position,Variable &v,const char *format):UIIntVarField(position,v,format,0,v.GetListSize(),0,0/*dummy 4 last*/){ 4 | NAssert(v.GetType()==Variable::CHAR_LIST) ; 5 | } ; 6 | 7 | 8 | void UISortedVarList::ProcessArrow(unsigned short mask) { 9 | int value=src_.GetInt() ; 10 | 11 | switch(mask) { 12 | case EPBM_UP: 13 | // HERE 14 | /* // Look for the first in next alphabet 15 | char search=src_.GetString()[0] ; 16 | 17 | value+=yOffset_ ; 18 | */ break ; 19 | case EPBM_DOWN: 20 | /* value-=yOffset_ ; 21 | break ; 22 | */ case EPBM_LEFT: 23 | value-=1 ; 24 | break ; 25 | case EPBM_RIGHT: 26 | value+=1 ; 27 | break ; 28 | } ; 29 | if (valuemax_) { 33 | value=max_ ; 34 | } 35 | 36 | src_.SetInt(value) ; 37 | } ; 38 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UISortedVarList.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_SORTED_VAR_LIST_H_ 2 | #define _UI_SORTED_VAR_LIST_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UISortedVarList: public UIIntVarField { 7 | 8 | public: 9 | 10 | UISortedVarList(GUIPoint &position,Variable &v,const char *format) ; 11 | virtual ~UISortedVarList() {} ; 12 | virtual void ProcessArrow(unsigned short mask) ; 13 | } ; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIStaticField.cpp: -------------------------------------------------------------------------------- 1 | #include "UIStaticField.h" 2 | #include "Application/AppWindow.h" 3 | 4 | UIStaticField::UIStaticField(GUIPoint &position,const char *string):UIField(position) { 5 | string_=string ; 6 | } ; 7 | 8 | void UIStaticField::Draw(GUIWindow &w,int offset) { 9 | 10 | GUITextProperties props ; 11 | GUIPoint position=GetPosition() ; 12 | position._y+=offset ; 13 | 14 | ((AppWindow&)w).SetColor(CD_NORMAL) ; 15 | w.DrawString(string_,position,props) ; 16 | } ; 17 | 18 | void UIStaticField::ProcessArrow(unsigned short mask){ 19 | } ; 20 | 21 | bool UIStaticField::IsStatic() { 22 | return true ; 23 | } ; 24 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIStaticField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_STATIC_FIELD_H_ 2 | #define _UI_STATIC_FIELD_H_ 3 | 4 | #include "UIField.h" 5 | 6 | class UIStaticField: public UIField { 7 | 8 | public: 9 | 10 | UIStaticField(GUIPoint &position,const char *string) ; 11 | virtual ~UIStaticField() {} ; 12 | virtual void Draw(GUIWindow &w, int offset=0) ; 13 | virtual void ProcessArrow(unsigned short mask) ; 14 | virtual void OnClick() {} ; 15 | 16 | virtual bool IsStatic() ; 17 | 18 | protected: 19 | 20 | protected: 21 | const char *string_ ; 22 | 23 | } ; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UITempoField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_TEMPOFIELD_H_ 2 | #define _UI_TEMPOFIELD_H_ 3 | 4 | #include "UIIntVarField.h" 5 | #include "Foundation/Observable.h" 6 | 7 | class UITempoField: public UIIntVarField,public Observable,public I_Observer { 8 | public: 9 | UITempoField(FourCC action,GUIPoint &position,Variable &variable,const char *format,int min,int max,int xOffset,int yOffset) ; 10 | virtual void OnBClick() ; 11 | void Update(Observable &,I_ObservableData *) ; 12 | void ProcessArrow(unsigned short mask) ; 13 | void ProcessBArrow(unsigned short mask) ; 14 | 15 | private: 16 | FourCC action_ ; 17 | 18 | 19 | } ; 20 | #endif 21 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/ViewEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ViewEvent.h" 3 | 4 | ViewEvent::ViewEvent(ViewEventType type,void *data) { 5 | type_=type ; 6 | data_=data ; 7 | } ; 8 | 9 | ViewEventType ViewEvent::GetType() { 10 | return type_ ; 11 | } ; 12 | 13 | void *ViewEvent::GetData() { 14 | return data_ ; 15 | } ; 16 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/ViewEvent.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEW_EVENT_H_ 2 | #define _VIEW_EVENT_H_ 3 | 4 | #include "Foundation/Observable.h" 5 | 6 | enum ViewEventType { 7 | VET_SWITCH_VIEW, 8 | VET_PLAYER_POSITION_UPDATE, 9 | VET_LIST_SELECT, 10 | VET_QUIT_PROJECT, 11 | VET_UPDATE, 12 | VET_QUIT_APP 13 | } ; 14 | 15 | class ViewEvent: public I_ObservableData { 16 | public: 17 | ViewEvent(ViewEventType type,void *data=0) ; 18 | ViewEventType GetType() ; 19 | void *GetData() ; 20 | private: 21 | ViewEventType type_ ; 22 | void *data_ ; 23 | } ; 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /sources/Application/Views/ConsoleView.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ConsoleView.h" 3 | #include 4 | 5 | ConsoleView::ConsoleView(GUIWindow &w,ViewData *viewData):View(w,viewData) { 6 | currentLine_=0 ; 7 | for (int i=0;i &) ; 18 | 19 | // Observer for action callback 20 | 21 | void Update(Observable &,I_ObservableData *) ; 22 | 23 | private: 24 | T_SimpleList content_ ; 25 | int topIndex_ ; 26 | } ; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Application/Views/ModalDialogs/ImportSampleDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _IMPORT_SAMPLE_DIALOG_H_ 2 | #define _IMPORT_SAMPLE_DIALOG_H_ 3 | 4 | #include "Application/Views/BaseClasses/ModalView.h" 5 | #include "Foundation/T_SimpleList.h" 6 | #include "System/FileSystem/FileSystem.h" 7 | #include 8 | 9 | class ImportSampleDialog:public ModalView { 10 | public: 11 | ImportSampleDialog(View &view) ; 12 | virtual ~ImportSampleDialog() ; 13 | 14 | virtual void DrawView() ; 15 | virtual void OnPlayerUpdate(PlayerEventType ,unsigned int currentTick) ; 16 | virtual void OnFocus() ; 17 | virtual void ProcessButtonMask(unsigned short mask,bool pressed) ; 18 | 19 | protected: 20 | void setCurrentFolder(Path *path) ; 21 | void warpToNextSample(int dir) ; 22 | void import(Path &element) ; 23 | void preview(Path &element) ; 24 | private: 25 | T_SimpleList sampleList_ ; 26 | int currentSample_ ; 27 | int topIndex_ ; 28 | int toInstr_ ; 29 | int selected_ ; 30 | static bool initStatic_ ; 31 | static Path sampleLib_ ; 32 | static Path currentPath_ ; 33 | 34 | } ; 35 | 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /sources/Application/Views/ModalDialogs/MessageBox.h: -------------------------------------------------------------------------------- 1 | #ifndef _MESSAGE_BOX_H_ 2 | #define _MESSAGE_BOX_H_ 3 | 4 | #include "Application/Views/BaseClasses/ModalView.h" 5 | #include 6 | 7 | #ifdef MessageBox 8 | #undef MessageBox 9 | #endif 10 | 11 | enum MessageBoxList { 12 | MBL_OK=0, 13 | MBL_YES, 14 | MBL_CANCEL, 15 | MBL_NO, 16 | MBL_LAST 17 | } ; 18 | 19 | enum MessageBoxButtonFlag { 20 | MBBF_OK=1, 21 | MBBF_YES=2, 22 | MBBF_CANCEL=4, 23 | MBBF_NO=8 24 | } ; 25 | 26 | class MessageBox:public ModalView { 27 | public: 28 | MessageBox(View &view,const char *message,int btnFlags=MBBF_OK) ; 29 | virtual ~MessageBox() ; 30 | 31 | virtual void DrawView() ; 32 | virtual void OnPlayerUpdate(PlayerEventType ,unsigned int currentTick) ; 33 | virtual void OnFocus() ; 34 | virtual void ProcessButtonMask(unsigned short mask,bool pressed) ; 35 | private: 36 | std::string message_ ; 37 | int button_[4] ; 38 | int buttonCount_ ; 39 | int selected_ ; 40 | } ; 41 | #endif -------------------------------------------------------------------------------- /sources/Application/Views/ModalDialogs/NewProjectDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _NEW_PROJECT_DIALOG_H_ 2 | #define _NEW_PROJECT_DIALOG_H_ 3 | 4 | #include "Application/Views/BaseClasses/ModalView.h" 5 | #include 6 | 7 | #define MAX_NAME_LENGTH 12 8 | 9 | class NewProjectDialog:public ModalView { 10 | public: 11 | NewProjectDialog(View &view) ; 12 | virtual ~NewProjectDialog() ; 13 | 14 | virtual void DrawView() ; 15 | virtual void OnPlayerUpdate(PlayerEventType ,unsigned int currentTick) ; 16 | virtual void OnFocus() ; 17 | virtual void ProcessButtonMask(unsigned short mask,bool pressed) ; 18 | 19 | std::string GetName() ; 20 | private: 21 | int selected_ ; 22 | int lastChar_ ; 23 | char name_[MAX_NAME_LENGTH+1] ; 24 | int currentChar_ ; 25 | } ; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sources/Application/Views/ModalDialogs/SelectProjectDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _SELECT_PROJECT_DIALOG_H_ 2 | #define _SELECT_PROJECT_DIALOG_H_ 3 | 4 | #include "Application/Views/BaseClasses/ModalView.h" 5 | #include "System/FileSystem/FileSystem.h" 6 | #include "System/Errors/Result.h" 7 | 8 | class SelectProjectDialog:public ModalView { 9 | public: 10 | SelectProjectDialog(View &view) ; 11 | ~SelectProjectDialog() ; 12 | 13 | virtual void DrawView() ; 14 | virtual void OnPlayerUpdate(PlayerEventType ,unsigned int currentTick) ; 15 | virtual void OnFocus() ; 16 | virtual void ProcessButtonMask(unsigned short mask,bool pressed) ; 17 | 18 | Result OnNewProject(std::string &name) ; 19 | 20 | Path GetSelection() ; 21 | 22 | protected: 23 | void warpToNextProject(int amount) ; 24 | void setCurrentFolder(Path &path) ; 25 | 26 | private: 27 | T_SimpleList content_ ; 28 | int topIndex_ ; 29 | int currentProject_ ; 30 | int selected_ ; 31 | Path currentPath_ ; 32 | Path selection_ ; 33 | static Path lastFolder_ ; 34 | static int lastProject_ ; 35 | } ; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /sources/Application/Views/NullView.cpp: -------------------------------------------------------------------------------- 1 | #include "NullView.h" 2 | 3 | NullView::NullView(GUIWindow &w,ViewData *viewData):View(w,viewData) { 4 | } 5 | 6 | NullView::~NullView() { 7 | } 8 | 9 | void NullView::ProcessButtonMask(unsigned short mask,bool pressed) { 10 | 11 | } ; 12 | 13 | void NullView::DrawView() { 14 | 15 | Clear() ; 16 | 17 | 18 | GUITextProperties props; 19 | SetColor(CD_HILITE2) ; 20 | 21 | char buildString[80] ; 22 | sprintf(buildString,"Piggy build %s%s_%s",PROJECT_NUMBER,PROJECT_RELEASE,BUILD_COUNT) ; 23 | GUIPoint pos ; 24 | pos._y=28; 25 | pos._x=(40-strlen(buildString))/2 ; 26 | DrawString(pos._x,pos._y,buildString,props) ; 27 | 28 | } ; 29 | 30 | void NullView::OnPlayerUpdate(PlayerEventType ,unsigned int tick) { 31 | 32 | } ; 33 | 34 | void NullView::OnFocus() { 35 | } ; 36 | -------------------------------------------------------------------------------- /sources/Application/Views/NullView.h: -------------------------------------------------------------------------------- 1 | #ifndef _NULL_VIEW_H_ 2 | #define _NULL_VIEW_H_ 3 | 4 | #include "BaseClasses/View.h" 5 | #include "ViewData.h" 6 | 7 | class NullView: public View { 8 | public: 9 | NullView(GUIWindow &w,ViewData *viewData) ; 10 | ~NullView() ; 11 | virtual void ProcessButtonMask(unsigned short mask,bool pressed) ; 12 | virtual void DrawView() ; 13 | virtual void OnPlayerUpdate(PlayerEventType ,unsigned int tick=0) ; 14 | virtual void OnFocus() ; 15 | private: 16 | 17 | } ; 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /sources/Application/Views/ProjectView.h: -------------------------------------------------------------------------------- 1 | #ifndef _PROJECT_VIEW_H_ 2 | #define _PROJECT_VIEW_H_ 3 | 4 | #include "BaseClasses/FieldView.h" 5 | #include "Foundation/Observable.h" 6 | #include "ViewData.h" 7 | 8 | 9 | class ProjectView: public FieldView,public I_Observer { 10 | public: 11 | ProjectView(GUIWindow &w,ViewData *data) ; 12 | virtual ~ProjectView() ; 13 | 14 | virtual void ProcessButtonMask(unsigned short mask,bool pressed) ; 15 | virtual void DrawView() ; 16 | virtual void OnPlayerUpdate(PlayerEventType,unsigned int) {} ; 17 | virtual void OnFocus() {} ; 18 | 19 | // Observer for action callback 20 | 21 | void Update(Observable &,I_ObservableData *) ; 22 | 23 | void OnLoadProject() ; 24 | void OnPurgeInstruments(bool removeFromDisk) ; 25 | void OnQuit() ; 26 | 27 | protected: 28 | private: 29 | Project *project_ ; 30 | // Debug 31 | unsigned long lastTick_ ; 32 | unsigned long lastClock_ ; 33 | UIField *tempoField_ ; 34 | } ; 35 | #endif 36 | -------------------------------------------------------------------------------- /sources/Application/Views/UIController.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_CONTROLLER_H 2 | #define _UI_CONTROLLER_H 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "ViewData.h" 6 | 7 | class UIController: public T_Singleton { 8 | private: // Singleton 9 | UIController() ; 10 | public: 11 | static UIController *GetInstance() ; 12 | void Init(Project*,ViewData *) ; 13 | void Reset() ; 14 | 15 | // Muting functions 16 | 17 | void UnMuteAll() ; 18 | void ToggleMute(int from,int to) ; 19 | void SwitchSoloMode(int from,int to,bool clear) ; 20 | 21 | private: 22 | Project *project_ ; 23 | ViewData *viewData_ ; 24 | 25 | bool soloMask_[SONG_CHANNEL_COUNT] ; 26 | } ; 27 | #endif 28 | -------------------------------------------------------------------------------- /sources/Externals/RTAudio/include/asiodrivers.h: -------------------------------------------------------------------------------- 1 | #ifndef __AsioDrivers__ 2 | #define __AsioDrivers__ 3 | 4 | #include "ginclude.h" 5 | 6 | #if MAC 7 | #include "CodeFragments.hpp" 8 | 9 | class AsioDrivers : public CodeFragments 10 | 11 | #elif WINDOWS 12 | #include 13 | #include "asiolist.h" 14 | 15 | class AsioDrivers : public AsioDriverList 16 | 17 | #elif SGI || BEOS 18 | #include "asiolist.h" 19 | 20 | class AsioDrivers : public AsioDriverList 21 | 22 | #else 23 | #error implement me 24 | #endif 25 | 26 | { 27 | public: 28 | AsioDrivers(); 29 | ~AsioDrivers(); 30 | 31 | bool getCurrentDriverName(char *name); 32 | long getDriverNames(char **names, long maxDrivers); 33 | bool loadDriver(char *name); 34 | void removeCurrentDriver(); 35 | long getCurrentDriverIndex() {return curIndex;} 36 | protected: 37 | unsigned long connID; 38 | long curIndex; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sources/Externals/RTAudio/include/asiolist.h: -------------------------------------------------------------------------------- 1 | #ifndef __asiolist__ 2 | #define __asiolist__ 3 | 4 | #define DRVERR -5000 5 | #define DRVERR_INVALID_PARAM DRVERR-1 6 | #define DRVERR_DEVICE_ALREADY_OPEN DRVERR-2 7 | #define DRVERR_DEVICE_NOT_FOUND DRVERR-3 8 | 9 | #define MAXPATHLEN 512 10 | #define MAXDRVNAMELEN 128 11 | 12 | struct asiodrvstruct 13 | { 14 | int drvID; 15 | CLSID clsid; 16 | char dllpath[MAXPATHLEN]; 17 | char drvname[MAXDRVNAMELEN]; 18 | LPVOID asiodrv; 19 | struct asiodrvstruct *next; 20 | }; 21 | 22 | typedef struct asiodrvstruct ASIODRVSTRUCT; 23 | typedef ASIODRVSTRUCT *LPASIODRVSTRUCT; 24 | 25 | class AsioDriverList { 26 | public: 27 | AsioDriverList(); 28 | ~AsioDriverList(); 29 | 30 | LONG asioOpenDriver (int,VOID **); 31 | LONG asioCloseDriver (int); 32 | 33 | // nice to have 34 | LONG asioGetNumDev (VOID); 35 | LONG asioGetDriverName (int,char *,int); 36 | LONG asioGetDriverPath (int,char *,int); 37 | LONG asioGetDriverCLSID (int,CLSID *); 38 | 39 | // or use directly access 40 | LPASIODRVSTRUCT lpdrvlist; 41 | int numdrv; 42 | }; 43 | 44 | typedef class AsioDriverList *LPASIODRIVERLIST; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sources/Externals/RTAudio/include/ginclude.h: -------------------------------------------------------------------------------- 1 | #ifndef __gInclude__ 2 | #define __gInclude__ 3 | 4 | #if SGI 5 | #undef BEOS 6 | #undef MAC 7 | #undef WINDOWS 8 | // 9 | #define ASIO_BIG_ENDIAN 1 10 | #define ASIO_CPU_MIPS 1 11 | #elif defined WIN32 12 | #undef BEOS 13 | #undef MAC 14 | #undef SGI 15 | #define WINDOWS 1 16 | #define ASIO_LITTLE_ENDIAN 1 17 | #define ASIO_CPU_X86 1 18 | #elif BEOS 19 | #undef MAC 20 | #undef SGI 21 | #undef WINDOWS 22 | #define ASIO_LITTLE_ENDIAN 1 23 | #define ASIO_CPU_X86 1 24 | // 25 | #else 26 | #define MAC 1 27 | #undef BEOS 28 | #undef WINDOWS 29 | #undef SGI 30 | #define ASIO_BIG_ENDIAN 1 31 | #define ASIO_CPU_PPC 1 32 | #endif 33 | 34 | // always 35 | #define NATIVE_INT64 0 36 | #define IEEE754_64FLOAT 1 37 | 38 | #endif // __gInclude__ 39 | -------------------------------------------------------------------------------- /sources/Externals/SDL/SDL_byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2006 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /* DEPRECATED */ 24 | #include "SDL_endian.h" 25 | -------------------------------------------------------------------------------- /sources/Externals/SDL/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2006 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /sources/Externals/SDL/SDL_getenv.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2006 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /* DEPRECATED */ 24 | #include "SDL_stdinc.h" 25 | -------------------------------------------------------------------------------- /sources/Externals/SDL/SDL_name.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDLname_h_ 3 | #define _SDLname_h_ 4 | 5 | #if defined(__STDC__) || defined(__cplusplus) 6 | #define NeedFunctionPrototypes 1 7 | #endif 8 | 9 | #define SDL_NAME(X) SDL_##X 10 | 11 | #endif /* _SDLname_h_ */ 12 | -------------------------------------------------------------------------------- /sources/Externals/SDL/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2006 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /* DEPRECATED */ 24 | #include "SDL_stdinc.h" 25 | -------------------------------------------------------------------------------- /sources/Externals/Soundfont/SFLOOKUP.H: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | 3 | sflookup.h 4 | 5 | Copyright (c) Creative Technology Ltd. 1995. All Rights Reserved. 6 | 7 | THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 8 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9 | IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 10 | PURPOSE. 11 | 12 | *********************************************************************/ 13 | #ifndef __SFLOOKUP_H 14 | #define __SFLOOKUP_H 15 | 16 | #include "DATATYPE.H" 17 | 18 | #define MEMBEROFFSET(typ, mbr) \ 19 | ((WORD) ((CHAR*) &((typ*) 0)->mbr - (CHAR*) 0)) 20 | 21 | #ifdef _UNIX_STUB_ 22 | typedef DWORD SFLOOKUP; 23 | #else 24 | typedef WORD SFLOOKUP; 25 | #endif 26 | 27 | void InitLookup(void); 28 | void ClearLookup(void); 29 | const SFLOOKUP *GetLookup(void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Externals/TinyXML/Tiny2NosStub.cpp: -------------------------------------------------------------------------------- 1 | #include "Tiny2NosStub.h" 2 | #include "System/Console/Trace.h" 3 | #include 4 | #include 5 | 6 | void fprintf(I_File *f,char *fmt,...) { 7 | char buffer[256] ; 8 | va_list args; 9 | va_start(args,fmt); 10 | 11 | vsprintf(buffer,fmt,args); 12 | int len=strlen(buffer) ; 13 | f->Write(buffer,1,len) ; 14 | 15 | } ; 16 | -------------------------------------------------------------------------------- /sources/Externals/TinyXML/Tiny2NosStub.h: -------------------------------------------------------------------------------- 1 | #ifndef _TINY2NOSSTUP_H_ 2 | #define _TINY2NOSSTUP_H_ 3 | #include 4 | #include "System/FileSystem/FileSystem.h" 5 | #include "System/Console/n_assert.h" 6 | 7 | #ifdef FILE 8 | #undef FILE 9 | #endif 10 | #define FILE I_File 11 | #define fopen(a,b) FileSystem::GetInstance()->Open(a,b) 12 | #define fclose(a) a->Close() ; delete (a) 13 | #define fseek(a,b,c) a->Seek(b,c) 14 | #define ftell(a) a->Tell() 15 | #define fputs(a,b) b->Write(a,1,strlen(a)) 16 | #define fread(a,b,c,d) d->Read(a,b,c) 17 | extern void fprintf(FILE *f,char *fmt,...) ; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Foundation/Observable.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Observable.h" 3 | 4 | #include "T_SimpleList.h" 5 | 6 | Observable::Observable() { 7 | _hasChanged=false ; 8 | } 9 | 10 | Observable::~Observable() { 11 | } 12 | 13 | void Observable::AddObserver(I_Observer &o) { 14 | _list.push_back(&o) ; 15 | } 16 | 17 | void Observable::RemoveObserver(I_Observer &o) { 18 | std::vector::iterator it=_list.begin() ; 19 | while (it!=_list.end()) { 20 | if (*it==&o) { 21 | _list.erase(it) ; 22 | break ; 23 | } 24 | it++ ; 25 | } 26 | } 27 | 28 | void Observable::RemoveAllObservers() { 29 | std::vector::iterator it=_list.begin() ; 30 | while (it!=_list.end()) { 31 | it=_list.erase(it) ; 32 | } 33 | } 34 | 35 | void Observable::NotifyObservers(I_ObservableData *d) { 36 | if (_hasChanged) { 37 | std::vector::iterator it=_list.begin() ; 38 | while (it!=_list.end()) { 39 | I_Observer *o=*it++ ; 40 | o->Update(*this,d) ; 41 | } 42 | ClearChanged() ; 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | } 52 | 53 | void Observable::SetChanged() { 54 | _hasChanged=true ; 55 | } 56 | 57 | bool Observable::HasChanged() { 58 | return _hasChanged ; 59 | } 60 | -------------------------------------------------------------------------------- /sources/Foundation/Observable.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | // Data to be passed from the observable to the observer 7 | 8 | class I_ObservableData { 9 | } ; 10 | 11 | // The observer: Simply allows to be notified with data 12 | 13 | class Observable ; 14 | 15 | class I_Observer { 16 | public: 17 | virtual ~I_Observer() {} ; 18 | virtual void Update(Observable &o,I_ObservableData *d)=0 ; 19 | } ; 20 | 21 | // The observable 22 | 23 | class Observable { 24 | public: 25 | Observable() ; 26 | virtual ~Observable() ; 27 | void AddObserver(I_Observer &o) ; 28 | void RemoveObserver(I_Observer &o) ; 29 | void RemoveAllObservers() ; 30 | int CountObservers() ; 31 | 32 | inline void NotifyObservers() { NotifyObservers(0) ; } ; 33 | 34 | void NotifyObservers(I_ObservableData *d) ; 35 | 36 | void SetChanged() ; 37 | inline void ClearChanged() { _hasChanged=false ; } ; 38 | bool HasChanged() ; 39 | private: 40 | std::vector _list ; 41 | bool _hasChanged ; 42 | }; 43 | 44 | 45 | -------------------------------------------------------------------------------- /sources/Foundation/Services/Service.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Service.h" 3 | #include "ServiceRegistry.h" 4 | 5 | Service::Service(int fourCC) { 6 | fourCC_=fourCC ; 7 | ServiceRegistry::GetInstance()->Register(this) ; 8 | } ; 9 | 10 | Service::~Service() { 11 | } ; 12 | 13 | void Service::Register(SubService *sub) { 14 | Insert(sub) ; 15 | } ; 16 | 17 | void Service::Unregister(SubService *sub) { 18 | Remove(*sub) ; 19 | } ; 20 | 21 | -------------------------------------------------------------------------------- /sources/Foundation/Services/Service.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SERVICE_H_ 3 | #define _SERVICE_H_ 4 | 5 | #include "SubService.h" 6 | #include "Foundation/T_SimpleList.h" 7 | 8 | class Service:protected T_SimpleList { 9 | public: 10 | Service(int fourCC); 11 | virtual ~Service() ; 12 | virtual void Register(SubService *) ; 13 | virtual void Unregister(SubService *) ; 14 | int GetFourCC() { return fourCC_ ; } ; 15 | private: 16 | int fourCC_ ; 17 | } ; 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Foundation/Services/ServiceRegistry.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ServiceRegistry.h" 3 | 4 | void ServiceRegistry::Register(Service *s) { 5 | services_.Insert(s) ; 6 | } ; 7 | 8 | void ServiceRegistry::Register(SubService *s) { 9 | IteratorPtr it(services_.GetIterator()) ; 10 | for (it->Begin();!it->IsDone();it->Next()) { 11 | Service ¤t=it->CurrentItem() ; 12 | if (current.GetFourCC()==s->GetFourCC()) { 13 | current.Register(s) ; 14 | } ; 15 | } ; 16 | } ; 17 | 18 | void ServiceRegistry::Unregister(SubService *s) { 19 | IteratorPtr it(services_.GetIterator()) ; 20 | for (it->Begin();!it->IsDone();it->Next()) { 21 | Service ¤t=it->CurrentItem() ; 22 | if (current.GetFourCC()==s->GetFourCC()) { 23 | current.Unregister(s) ; 24 | } ; 25 | } ; 26 | } ; 27 | 28 | -------------------------------------------------------------------------------- /sources/Foundation/Services/ServiceRegistry.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SERVICE_REGISTRY_H_ 3 | #define _SERVICE_REGISTRY_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "Service.h" 7 | #include "SubService.h" 8 | 9 | class ServiceRegistry: public T_Singleton { 10 | public: 11 | void Register(Service *) ; 12 | void Register(SubService *) ; 13 | void Unregister(SubService *) ; 14 | protected: 15 | T_SimpleList services_ ; 16 | } ; 17 | #endif 18 | -------------------------------------------------------------------------------- /sources/Foundation/Services/SubService.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "SubService.h" 3 | #include "ServiceRegistry.h" 4 | 5 | SubService::SubService(int fourCC) { 6 | fourCC_=fourCC ; 7 | ServiceRegistry::GetInstance()->Register(this) ; 8 | } ; 9 | 10 | SubService::~SubService() { 11 | ServiceRegistry::GetInstance()->Unregister(this) ; 12 | } ; 13 | -------------------------------------------------------------------------------- /sources/Foundation/Services/SubService.h: -------------------------------------------------------------------------------- 1 | #ifndef _SUBSERVICE_H_ 2 | #define _SUBSERVICE_H_ 3 | 4 | class SubService { 5 | public: 6 | SubService(int fourCC); 7 | virtual ~SubService() ; 8 | int GetFourCC() { return fourCC_ ; } ; 9 | private: 10 | int fourCC_ ; 11 | } ; 12 | #endif 13 | -------------------------------------------------------------------------------- /sources/Foundation/SingletonRegistry.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "SingletonRegistry.h" 3 | 4 | SingletonRegistry _instance ; 5 | 6 | SingletonRegistry::SingletonRegistry():T_SimpleList(true) { 7 | } ; 8 | 9 | SingletonRegistry::~SingletonRegistry() { 10 | } ; 11 | 12 | SingletonRegistry *SingletonRegistry::GetInstance() { 13 | return &_instance ; 14 | } ; 15 | -------------------------------------------------------------------------------- /sources/Foundation/SingletonRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef _SINGLETON_REGISTRY_H_ 2 | #define _SINGLETON_REGISTRY_H_ 3 | 4 | #include "T_SimpleList.h" 5 | 6 | class I_Singleton { 7 | public: 8 | virtual ~I_Singleton() {} ; 9 | } ; 10 | 11 | class SingletonRegistry: public T_SimpleList { 12 | public: 13 | static SingletonRegistry *GetInstance() ; 14 | 15 | SingletonRegistry() ; 16 | ~SingletonRegistry() ; 17 | 18 | } ; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sources/Foundation/T_Factory.cpp: -------------------------------------------------------------------------------- 1 | 2 | template Item* T_Factory::instance_=0 ; 3 | 4 | template 5 | void T_Factory::Install(Item *instance) { 6 | instance_=instance ; 7 | } 8 | template 9 | Item* T_Factory::GetInstance() { 10 | return instance_ ; 11 | } 12 | -------------------------------------------------------------------------------- /sources/Foundation/T_Factory.h: -------------------------------------------------------------------------------- 1 | #ifndef _T_FACTORY_H_ 2 | #define _T_FACTORY_H_ 3 | 4 | // 5 | // Encapsulate a Factory pattern allowing the installation 6 | // of different factories matching one given interface with 7 | // only one available at the time 8 | // 9 | 10 | template 11 | class T_Factory { 12 | protected: 13 | virtual ~T_Factory() {} ; 14 | public : 15 | 16 | // Install the factory to use 17 | 18 | static void Install(Item *) ; 19 | 20 | // Get the currently installed factory 21 | 22 | static Item *GetInstance() ; 23 | 24 | protected: 25 | 26 | // The static instance of the singleton 27 | 28 | static Item * instance_ ; 29 | } ; 30 | 31 | #include "T_Factory.cpp" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /sources/Foundation/T_SimpleListIterator.cpp: -------------------------------------------------------------------------------- 1 | #include "System/Console/n_assert.h" 2 | 3 | // 4 | // Implementation of the Iterator working on the T_SimpleList 5 | // 6 | 7 | template 8 | T_SimpleListIterator::T_SimpleListIterator(T_SimpleList& list,bool reverse):_list(list),_reverse(reverse) { 9 | Begin() ; 10 | } 11 | 12 | template 13 | void T_SimpleListIterator::Begin() { 14 | if (_reverse) { 15 | _current=_list._last ; 16 | } else { 17 | _current=_list._first ; 18 | } 19 | 20 | } 21 | 22 | template 23 | void T_SimpleListIterator::Next() { 24 | NAssert(!IsDone()) ; 25 | if (_reverse) { 26 | _current=_current->prev ; 27 | } else { 28 | _current=_current->next ; 29 | } 30 | } 31 | 32 | template 33 | bool T_SimpleListIterator::IsDone() const { 34 | return (_current==NULL) ; 35 | } 36 | 37 | template 38 | Item &T_SimpleListIterator::CurrentItem() const { 39 | NAssert(!IsDone()) ; 40 | return _current->data ; 41 | } 42 | -------------------------------------------------------------------------------- /sources/Foundation/T_Singleton.cpp: -------------------------------------------------------------------------------- 1 | 2 | template Item* T_Singleton::instance_=0 ; 3 | 4 | template 5 | T_Singleton::T_Singleton() { 6 | #ifdef PLATFORM_WINDOWS 7 | SingletonRegistry *registry=SingletonRegistry::GetInstance() ; 8 | registry->Insert(this) ; 9 | #endif 10 | } 11 | 12 | 13 | template 14 | T_Singleton::~T_Singleton() { 15 | } 16 | 17 | template 18 | Item* T_Singleton::GetInstance() { 19 | if (instance_==0) { 20 | instance_=new Item ; 21 | } ; 22 | return instance_ ; 23 | } 24 | -------------------------------------------------------------------------------- /sources/Foundation/T_Singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef _T_SINGLETON_H_ 2 | #define _T_SINGLETON_H_ 3 | 4 | #include "SingletonRegistry.h" 5 | 6 | template 7 | class T_Singleton: public I_Singleton { 8 | protected: 9 | 10 | T_Singleton() ; 11 | virtual ~T_Singleton() ; 12 | 13 | public: 14 | 15 | // Get the currently installed factory 16 | 17 | static Item *GetInstance() ; 18 | 19 | protected: 20 | 21 | // The static instance of the singleton 22 | 23 | static Item * instance_ ; 24 | } ; 25 | 26 | #include "T_Singleton.cpp" // Include the implementation file. 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Foundation/T_Stack.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "T_Stack.h" 3 | 4 | template 5 | T_Stack::T_Stack(bool isOwner):T_SimpleList(isOwner) { 6 | _size=0 ; 7 | } ; 8 | 9 | template 10 | void T_Stack::Push(Item &i) { 11 | this->Insert(i) ; 12 | } 13 | 14 | template 15 | Item *T_Stack::Pop(bool lifo) { 16 | Item *i ; 17 | if (lifo) { // Last in first out 18 | i=this->GetFirst() ; 19 | } else { 20 | i=this->GetLast() ; 21 | } 22 | if (i!=NULL) { // First in first out 23 | this->Remove(*i,false) ; 24 | _size--; 25 | } 26 | return i; 27 | } 28 | 29 | template 30 | void T_Stack::Insert(Item &i) { 31 | T_SimpleList::Insert(i) ; 32 | _size++ ; 33 | } 34 | 35 | template 36 | void T_Stack::Insert(Item *i) { 37 | T_SimpleList::Insert(*i) ; 38 | _size++ ; 39 | } 40 | 41 | template 42 | void T_Stack::Empty() { 43 | T_SimpleList::Empty() ; 44 | } 45 | -------------------------------------------------------------------------------- /sources/Foundation/T_Stack.h: -------------------------------------------------------------------------------- 1 | #ifndef _T_STACK_H_ 2 | #define _T_STACK_H_ 3 | 4 | #include "T_SimpleList.h" 5 | 6 | template 7 | class T_Stack: protected T_SimpleList { 8 | public: 9 | T_Stack(bool isOwner=false) ; 10 | virtual ~T_Stack() {} ; 11 | void Push(Item &) ; 12 | Item *Pop(bool lifo=false) ; 13 | virtual void Insert(Item&) ; 14 | virtual void Insert(Item*) ; 15 | void Empty() ; 16 | int Size() { return _size ; } ; 17 | private: 18 | int _size ; 19 | bool _lifo ; 20 | } ; 21 | 22 | #include "T_Stack.cpp" // Include the implementation file. 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Foundation/Types/Types.h: -------------------------------------------------------------------------------- 1 | #ifndef _APP_TYPES_H_ 2 | #define _APP_TYPES_H_ 3 | 4 | //#define FOURCC(i) (((i&0xff000000)>>24) | ((i&0x00ff0000)>>8) | ((i&0x0000ff00)<<8) | ((i&0x000000ff)<<24)) 5 | #ifdef __ppc__ 6 | #define MAKE_FOURCC(ch0,ch1,ch2,ch3) (ch3 | ch2<<8 | ch1<<16 | ch0<<24) 7 | #else 8 | #define MAKE_FOURCC(ch0,ch1,ch2,ch3) (ch0 | ch1<<8 | ch2<<16 | ch3<<24) 9 | #endif 10 | 11 | #ifdef WIN32 12 | #define strcasecmp _stricmp 13 | #endif 14 | 15 | typedef unsigned int FourCC ; 16 | typedef unsigned short ushort ; 17 | typedef unsigned int uint ; 18 | typedef unsigned char uchar ; 19 | 20 | #define MIN(a,b) ((a)<(b)?(a):(b)) 21 | #define MAX(a,b) ((a)<(b)?(a):(b)) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/VariableContainer.cpp: -------------------------------------------------------------------------------- 1 | #include "VariableContainer.h" 2 | #include 3 | 4 | VariableContainer::VariableContainer():T_SimpleList(true) { 5 | }; 6 | 7 | VariableContainer::~VariableContainer() { 8 | }; 9 | 10 | Variable *VariableContainer::FindVariable(FourCC id) { 11 | IteratorPtr it(GetIterator()) ; 12 | for (it->Begin();!it->IsDone();it->Next()) { 13 | Variable &v=it->CurrentItem() ; 14 | if (v.GetID()==id) { 15 | return &v ; 16 | }; 17 | }; 18 | return NULL ; 19 | } ; 20 | 21 | Variable *VariableContainer::FindVariable(const char *name) { 22 | IteratorPtr it(GetIterator()) ; 23 | for (it->Begin();!it->IsDone();it->Next()) { 24 | Variable &v=it->CurrentItem() ; 25 | if (!strcmp(v.GetName(),name)) { 26 | return &v ; 27 | }; 28 | }; 29 | return NULL ; 30 | } ; 31 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/VariableContainer.h: -------------------------------------------------------------------------------- 1 | #ifndef _VARIABLE_CONTAINER_H_ 2 | #define _VARIABLE_CONTAINER_H_ 3 | 4 | #include "Variable.h" 5 | #include "Foundation/T_SimpleList.h" 6 | 7 | class VariableContainer: public T_SimpleList { 8 | public: 9 | VariableContainer() ; 10 | virtual ~VariableContainer() ; 11 | Variable *FindVariable(FourCC id) ; 12 | Variable *FindVariable(const char *name) ; 13 | } ; 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/WatchedVariable.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "WatchedVariable.h" 3 | 4 | bool WatchedVariable::enabled_=true ; 5 | 6 | WatchedVariable::WatchedVariable(const char *name,FourCC id,int value) 7 | :Variable(name,id,value) { 8 | updating_=false ; 9 | } ; 10 | 11 | WatchedVariable::WatchedVariable(const char *name,FourCC id,bool value) 12 | :Variable(name,id,value) { 13 | updating_=false ; 14 | } ; 15 | 16 | WatchedVariable::WatchedVariable(const char *name,FourCC id,char **list,int size,int index) 17 | :Variable(name,id,list,size,index) { 18 | updating_=false ; 19 | } ; 20 | 21 | 22 | void WatchedVariable::onChange() { 23 | if (!updating_&&enabled_) { 24 | updating_=true ; 25 | SetChanged() ; 26 | NotifyObservers() ; 27 | updating_=false ; 28 | } 29 | } ; 30 | 31 | void WatchedVariable::Enable() { 32 | enabled_=true ; 33 | } 34 | 35 | void WatchedVariable::Disable() { 36 | enabled_=false ; 37 | } 38 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/WatchedVariable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WATCHED_VARIABLE_H_ 3 | #define _WATCHED_VARIABLE_H_ 4 | 5 | #include "Variable.h" 6 | #include "Foundation/Observable.h" 7 | 8 | class WatchedVariable : public Variable,public Observable { 9 | public: 10 | WatchedVariable(const char *name,FourCC id,int value=0) ; 11 | WatchedVariable(const char *name,FourCC id,bool value) ; 12 | WatchedVariable(const char *name,FourCC id,char **list,int size,int index=0) ; 13 | virtual ~WatchedVariable() {} ; 14 | static void Enable() ; 15 | static void Disable() ; 16 | 17 | protected: 18 | virtual void onChange() ; 19 | private: 20 | bool updating_ ; 21 | static bool enabled_ ; 22 | } ; 23 | #endif 24 | 25 | 26 | -------------------------------------------------------------------------------- /sources/Resources/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/sources/Resources/icon1.ico -------------------------------------------------------------------------------- /sources/Resources/lgpt_icon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mdashdotdashn/LittleGPTracker/4aca8cd765e1ad586da62decd019e66cb64b45b8/sources/Resources/lgpt_icon.bmp -------------------------------------------------------------------------------- /sources/Resources/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by lgpt.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /sources/Services/Audio/Audio.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _AUDIO_H_ 3 | #define _AUDIO_H_ 4 | 5 | #include "Foundation/T_Factory.h" 6 | #include "Foundation/T_SimpleList.h" 7 | #include "AudioOut.h" 8 | #include "AudioSettings.h" 9 | 10 | 11 | class Audio:public T_Factory