forked from Mdashdotdashn/LittleGPTracker
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Improve Midi Input Part 1 (#142)"
This reverts commit fbebbcf.
- Loading branch information
1 parent
fbebbcf
commit 13cdfa0
Showing
8 changed files
with
814 additions
and
857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,64 @@ | ||
#include "Application.h" | ||
|
||
#include "Application/AppWindow.h" | ||
#include "Application/Application.h" | ||
#include "Application/AppWindow.h" | ||
#include "UIFramework/Interfaces/I_GUIWindowFactory.h" | ||
#include "Application/Persistency/PersistencyService.h" | ||
#include "Services/Audio/Audio.h" | ||
#include "Application/Commands/CommandDispatcher.h" | ||
#include "Application/Controllers/ControlRoom.h" | ||
#include "Application/Model/Config.h" | ||
#include "Application/Persistency/PersistencyService.h" | ||
#include "Services/Audio/Audio.h" | ||
#include "Services/Midi/MidiService.h" | ||
#include "UIFramework/Interfaces/I_GUIWindowFactory.h" | ||
|
||
#include <math.h> | ||
|
||
Application *Application::instance_ = NULL; | ||
Application *Application::instance_=NULL ; | ||
|
||
Application::Application() {} | ||
Application::Application() { | ||
} | ||
|
||
void Application::initMidiInput() | ||
{ | ||
const char *preferedDevice=Config::GetInstance()->GetValue("MIDICTRLDEVICE"); | ||
|
||
void Application::initMidiInput() { | ||
const char *preferedDevice = | ||
Config::GetInstance()->GetValue("MIDICTRLDEVICE"); | ||
if (preferedDevice) { | ||
MidiService::GetInstance()->SelectDevice(preferedDevice); | ||
IteratorPtr<MidiInDevice>it(MidiService::GetInstance()->GetInIterator()) ; | ||
for(it->Begin();!it->IsDone();it->Next()) | ||
{ | ||
MidiInDevice &in=it->CurrentItem() ; | ||
if ((preferedDevice) && (!strncmp(in.GetName(), preferedDevice, strlen(preferedDevice)))) | ||
{ | ||
if (in.Init()) | ||
{ | ||
if (in.Start()) | ||
{ | ||
Trace::Log("MIDI","Controlling activated for MIDI interface %s",in.GetName()) ; | ||
} | ||
else | ||
{ | ||
in.Close() ; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
bool Application::Init(GUICreateWindowParams ¶ms) { | ||
const char *root = Config::GetInstance()->GetValue("ROOTFOLDER"); | ||
if (root) { | ||
Path::SetAlias("root", root); | ||
} | ||
window_ = AppWindow::Create(params); | ||
PersistencyService::GetInstance(); | ||
Audio *audio = Audio::GetInstance(); | ||
audio->Init(); | ||
CommandDispatcher::GetInstance()->Init(); | ||
initMidiInput(); | ||
ControlRoom::GetInstance()->LoadMapping("bin:mapping.xml"); | ||
return true; | ||
} | ||
const char* root=Config::GetInstance()->GetValue("ROOTFOLDER") ; | ||
if (root) { | ||
Path::SetAlias("root",root) ; | ||
} ; | ||
window_=AppWindow::Create(params) ; | ||
PersistencyService::GetInstance() ; | ||
Audio *audio=Audio::GetInstance() ; | ||
audio->Init() ; | ||
CommandDispatcher::GetInstance()->Init() ; | ||
initMidiInput(); | ||
ControlRoom::GetInstance()->LoadMapping("bin:mapping.xml") ; | ||
return true ; | ||
} ; | ||
|
||
GUIWindow *Application::GetWindow() { return window_; } | ||
GUIWindow *Application::GetWindow() { | ||
return window_ ; | ||
} ; | ||
|
||
Application::~Application() { delete window_; } | ||
Application::~Application() { | ||
delete window_ ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
#ifndef _APPLICATION_H_ | ||
#define _APPLICATION_H_ | ||
|
||
#include "Foundation/T_Singleton.h" | ||
#include "UIFramework/SimpleBaseClasses/GUIWindow.h" | ||
#include "Foundation/T_Singleton.h" | ||
|
||
class Application : public T_Singleton<Application> { | ||
|
||
public: | ||
Application(); | ||
~Application(); | ||
bool Init(GUICreateWindowParams ¶ms); | ||
class Application:public T_Singleton<Application> { | ||
|
||
GUIWindow *GetWindow(); | ||
public: | ||
Application() ; | ||
~Application() ; | ||
bool Init(GUICreateWindowParams ¶ms) ; | ||
|
||
protected: | ||
void initMidiInput(); | ||
GUIWindow *GetWindow() ; | ||
protected: | ||
void initMidiInput(); | ||
|
||
private: | ||
GUIWindow *window_; | ||
private: | ||
GUIWindow *window_ ; | ||
private: | ||
static Application* instance_ ; | ||
} ; | ||
|
||
private: | ||
static Application *instance_; | ||
}; | ||
#endif | ||
|
||
#endif // _APPLICATION_H_ |
Oops, something went wrong.