From 81516a2918e357648a8c3d45838b14d7ff9b1e71 Mon Sep 17 00:00:00 2001 From: asd Date: Tue, 31 May 2016 02:56:42 +0300 Subject: [PATCH] automatic routing functionality disabled, licensing disabled, version updated to 0.10.2 --- audio-router-gui/audio-router-gui.rc | Bin 12474 -> 11918 bytes audio-router-gui/dialog_array.cpp | 4 +- audio-router-gui/dialog_control.cpp | 208 +++++++++++++-------------- audio-router-gui/dialog_control.h | 8 +- audio-router-gui/main.cpp | 26 ++-- audio-router-gui/window.cpp | 7 +- audio-router-gui/window.h | 6 +- 7 files changed, 129 insertions(+), 130 deletions(-) diff --git a/audio-router-gui/audio-router-gui.rc b/audio-router-gui/audio-router-gui.rc index 0c3a1b61ed7bf49e816fb81f111e7c8a4fa80973..53b4014d8ab3bab3331dadb27af16b95c1651ed9 100644 GIT binary patch delta 16 Ycmdm$*cZE@L2>dtC9%zilz;F506|{|T>t<8 delta 306 zcmeB+-IchZK~Xz^!Ji?3Ary!e7?c=-84?-F7*ZKhfV?1ve1=kn5{68MJce|JVg{wj zjWXhs-$=_${vgjWxj|8c7p7W|0SG7i%d1WnP!wfU-G22(htWPBRc@ rA~xGxfUfWX;t(Kq1hRZET!hQ!CGtX(`@})M6q@``&T8`%#a}!C`tLuH diff --git a/audio-router-gui/dialog_array.cpp b/audio-router-gui/dialog_array.cpp index a025608..ab1e6a9 100644 --- a/audio-router-gui/dialog_array.cpp +++ b/audio-router-gui/dialog_array.cpp @@ -614,7 +614,7 @@ void dialog_array::choose_array_and_create_control(IAudioSessionControl* pSessio { dialog_control* control; dialog_array* arr = this->parent.find_control(pid, &control, 0); - bootstrapper& bootstrap = *this->parent.parent.bootstrap; + /*bootstrapper& bootstrap = *this->parent.parent.bootstrap;*/ // check if control is found on default: add session if found; // if not found on default: add to this if found in general; add to default if not found in general @@ -625,7 +625,7 @@ void dialog_array::choose_array_and_create_control(IAudioSessionControl* pSessio control->add_audio_session(pSessionControl2); return; } - else if(arr != NULL || bootstrap.is_managed_app(pid)) + else if(arr != NULL/* || bootstrap.is_managed_app(pid)*/) { this->create_control(pid, pSessionControl2); return; diff --git a/audio-router-gui/dialog_control.cpp b/audio-router-gui/dialog_control.cpp index 4f800ed..b1b0a6c 100644 --- a/audio-router-gui/dialog_control.cpp +++ b/audio-router-gui/dialog_control.cpp @@ -624,8 +624,8 @@ LRESULT dialog_control::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BO this->img.reset(new Bitmap(rc.bottom - rc.top, rc.right - rc.left)); // check if the application is implicitly routed, aka managed - bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap; - this->managed = bootstrap.is_saved_routing(this->pid, this->parent.get_device()); + /*bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;*/ + this->managed = false;//bootstrap.is_saved_routing(this->pid, this->parent.get_device()); return 0; } @@ -781,105 +781,105 @@ LRESULT dialog_control::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b return 0; } -LRESULT dialog_control::OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - if(this->MessageBoxW( - L"This will add a new saved routing for this application. It will not " \ - L"replace the old saved routings for this application. Do you wish to continue?", - L"Confirmation for Save", MB_OKCANCEL | MB_ICONQUESTION) != IDOK) - return 0; - - bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap; - - input_dialog input_dlg(2); - input_dlg.DoModal(*this); - if(IsBadReadPtr(this, sizeof(dialog_control))) - return 0; - const int sel_index = input_dlg.selected_index; - if(sel_index > 0) - { - app_inject::devices_t devices; - app_inject::get_devices(devices); - try - { - bootstrap.save_routing(this->pid, devices[sel_index - 1]); - } - catch(std::wstring err) - { - app_inject::clear_devices(devices); - this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR); - return 0; - } - app_inject::clear_devices(devices); - - dialog_main& main = this->parent.parent; - for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin(); - it != main.dialog_arrays.end(); - it++) - { - for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin(); - jt != (*it)->dialog_controls.end(); - jt++) - { - (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device()); - (*jt)->update_attributes(); - } - } - - this->MessageBoxW(L"Routing saved. Restart the application for the new settings " \ - L"to take effect.", - L"Success", MB_ICONINFORMATION); - } - else if(sel_index == 0) - this->MessageBoxW(L"You cannot save routing to the default device!", - NULL, MB_ICONERROR); - - return 0; -} - - -LRESULT dialog_control::OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap; - - if(this->MessageBoxW( - L"This will delete all the saved routings for this application. It won't " \ - L"delete the routings for any other application. Proceed?", - L"Confirmation for Delete All", MB_OKCANCEL | MB_ICONWARNING) != IDOK) - return 0; - - try - { - if(!bootstrap.delete_all(this->pid)) - { - this->MessageBoxW( - L"This application doesn't have any saved routings.", NULL, MB_ICONERROR); - return 0; - } - } - catch(std::wstring err) - { - this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR); - return 0; - } - - dialog_main& main = this->parent.parent; - for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin(); - it != main.dialog_arrays.end(); - it++) - { - for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin(); - jt != (*it)->dialog_controls.end(); - jt++) - { - (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device()); - (*jt)->update_attributes(); - } - } - - this->MessageBoxW(L"Saved routings for this application deleted. Restart " \ - L"the application for the new settings to take effect.", - L"Success", MB_ICONINFORMATION); - - return 0; -} +//LRESULT dialog_control::OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +//{ +// if(this->MessageBoxW( +// L"This will add a new saved routing for this application. It will not " \ +// L"replace the old saved routings for this application. Do you wish to continue?", +// L"Confirmation for Save", MB_OKCANCEL | MB_ICONQUESTION) != IDOK) +// return 0; +// +// bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap; +// +// input_dialog input_dlg(2); +// input_dlg.DoModal(*this); +// if(IsBadReadPtr(this, sizeof(dialog_control))) +// return 0; +// const int sel_index = input_dlg.selected_index; +// if(sel_index > 0) +// { +// app_inject::devices_t devices; +// app_inject::get_devices(devices); +// try +// { +// bootstrap.save_routing(this->pid, devices[sel_index - 1]); +// } +// catch(std::wstring err) +// { +// app_inject::clear_devices(devices); +// this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR); +// return 0; +// } +// app_inject::clear_devices(devices); +// +// dialog_main& main = this->parent.parent; +// for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin(); +// it != main.dialog_arrays.end(); +// it++) +// { +// for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin(); +// jt != (*it)->dialog_controls.end(); +// jt++) +// { +// (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device()); +// (*jt)->update_attributes(); +// } +// } +// +// this->MessageBoxW(L"Routing saved. Restart the application for the new settings " \ +// L"to take effect.", +// L"Success", MB_ICONINFORMATION); +// } +// else if(sel_index == 0) +// this->MessageBoxW(L"You cannot save routing to the default device!", +// NULL, MB_ICONERROR); +// +// return 0; +//} + + +//LRESULT dialog_control::OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +//{ +// bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap; +// +// if(this->MessageBoxW( +// L"This will delete all the saved routings for this application. It won't " \ +// L"delete the routings for any other application. Proceed?", +// L"Confirmation for Delete All", MB_OKCANCEL | MB_ICONWARNING) != IDOK) +// return 0; +// +// try +// { +// if(!bootstrap.delete_all(this->pid)) +// { +// this->MessageBoxW( +// L"This application doesn't have any saved routings.", NULL, MB_ICONERROR); +// return 0; +// } +// } +// catch(std::wstring err) +// { +// this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR); +// return 0; +// } +// +// dialog_main& main = this->parent.parent; +// for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin(); +// it != main.dialog_arrays.end(); +// it++) +// { +// for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin(); +// jt != (*it)->dialog_controls.end(); +// jt++) +// { +// (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device()); +// (*jt)->update_attributes(); +// } +// } +// +// this->MessageBoxW(L"Saved routings for this application deleted. Restart " \ +// L"the application for the new settings to take effect.", +// L"Success", MB_ICONINFORMATION); +// +// return 0; +//} diff --git a/audio-router-gui/dialog_control.h b/audio-router-gui/dialog_control.h index 9eb5196..7b3f46a 100644 --- a/audio-router-gui/dialog_control.h +++ b/audio-router-gui/dialog_control.h @@ -116,8 +116,8 @@ class dialog_control : public CDialogImpl, public COwnerDraw, public COwnerDraw bootstrap; - try + //std::unique_ptr bootstrap; + //try + //{ + // // TODO: decide if create a dummy bootstapper in case if the initialization fails + // bootstrap.reset(new bootstrapper); + //} + //catch(std::wstring err) + //{ + // err += L"Audio Router will close."; + // MessageBox(NULL, err.c_str(), NULL, MB_ICONERROR); + // goto cleanup; + //} { - // TODO: decide if create a dummy bootstapper in case if the initialization fails - bootstrap.reset(new bootstrapper); - } - catch(std::wstring err) - { - err += L"Audio Router will close."; - MessageBox(NULL, err.c_str(), NULL, MB_ICONERROR); - goto cleanup; - } - { - window win(bootstrap.get()); + window win/*(bootstrap.get())*/; RECT r = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT + WIN_WIDTH, CW_USEDEFAULT + WIN_HEIGHT}; if(win.CreateEx(NULL, &r) == NULL) { diff --git a/audio-router-gui/window.cpp b/audio-router-gui/window.cpp index 674b798..196585a 100644 --- a/audio-router-gui/window.cpp +++ b/audio-router-gui/window.cpp @@ -2,7 +2,7 @@ telemetry* telemetry_m = NULL; -window::window(bootstrapper* bootstrap) : dlg_main_b(true), license(NULL), bootstrap(bootstrap) +window::window(/*bootstrapper* bootstrap*/) : dlg_main_b(true)/*, license(NULL)*//*, bootstrap(bootstrap)*/ { this->dlg_main = new dialog_main(*this); this->form_view = new formview(*this); @@ -22,7 +22,7 @@ int window::OnCreate(LPCREATESTRUCT lpcs) { telemetry_m = new telemetry; - this->license = new dialog_licensing(*this); + /*this->license = new dialog_licensing(*this);*/ this->m_hWndClient = this->dlg_main->Create(this->m_hWnd); this->dlg_main->ShowWindow(SW_SHOW); @@ -78,8 +78,7 @@ LRESULT window::OnFileRefreshlist(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWn LRESULT window::OnAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { this->MessageBoxW( - L"Audio Router test version 0.10.1.\n" \ - L"The testing license will expire after 1 June 16 in your local time.\n" \ + L"Audio Router version 0.10.2.\n" \ L"\nIf you come across any bugs(especially relating to routing or duplicating), " \ L"or just have an idea for a new feature, " \ L"please send a PM to the developer on reddit: reddit.com/user/audiorouterdev/", diff --git a/audio-router-gui/window.h b/audio-router-gui/window.h index ca13a1f..70d6b77 100644 --- a/audio-router-gui/window.h +++ b/audio-router-gui/window.h @@ -17,10 +17,10 @@ class window : public CFrameWindowImpl public: dialog_main* dlg_main; formview* form_view; - dialog_licensing* license; - bootstrapper* bootstrap; + /*dialog_licensing* license;*/ + /*bootstrapper* bootstrap;*/ - explicit window(bootstrapper*); + explicit window(/*bootstrapper**/); ~window(); DECLARE_FRAME_WND_CLASS(L"Audio Router", IDR_MAINFRAME);