Skip to content

Commit 81516a2

Browse files
committed
automatic routing functionality disabled, licensing disabled, version updated to 0.10.2
1 parent 5dfe140 commit 81516a2

File tree

7 files changed

+129
-130
lines changed

7 files changed

+129
-130
lines changed

audio-router-gui/audio-router-gui.rc

-556 Bytes
Binary file not shown.

audio-router-gui/dialog_array.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ void dialog_array::choose_array_and_create_control(IAudioSessionControl* pSessio
614614
{
615615
dialog_control* control;
616616
dialog_array* arr = this->parent.find_control(pid, &control, 0);
617-
bootstrapper& bootstrap = *this->parent.parent.bootstrap;
617+
/*bootstrapper& bootstrap = *this->parent.parent.bootstrap;*/
618618

619619
// check if control is found on default: add session if found;
620620
// 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
625625
control->add_audio_session(pSessionControl2);
626626
return;
627627
}
628-
else if(arr != NULL || bootstrap.is_managed_app(pid))
628+
else if(arr != NULL/* || bootstrap.is_managed_app(pid)*/)
629629
{
630630
this->create_control(pid, pSessionControl2);
631631
return;

audio-router-gui/dialog_control.cpp

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ LRESULT dialog_control::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
624624
this->img.reset(new Bitmap(rc.bottom - rc.top, rc.right - rc.left));
625625

626626
// check if the application is implicitly routed, aka managed
627-
bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
628-
this->managed = bootstrap.is_saved_routing(this->pid, this->parent.get_device());
627+
/*bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;*/
628+
this->managed = false;//bootstrap.is_saved_routing(this->pid, this->parent.get_device());
629629

630630
return 0;
631631
}
@@ -781,105 +781,105 @@ LRESULT dialog_control::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
781781
return 0;
782782
}
783783

784-
LRESULT dialog_control::OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
785-
{
786-
if(this->MessageBoxW(
787-
L"This will add a new saved routing for this application. It will not " \
788-
L"replace the old saved routings for this application. Do you wish to continue?",
789-
L"Confirmation for Save", MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
790-
return 0;
791-
792-
bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
793-
794-
input_dialog input_dlg(2);
795-
input_dlg.DoModal(*this);
796-
if(IsBadReadPtr(this, sizeof(dialog_control)))
797-
return 0;
798-
const int sel_index = input_dlg.selected_index;
799-
if(sel_index > 0)
800-
{
801-
app_inject::devices_t devices;
802-
app_inject::get_devices(devices);
803-
try
804-
{
805-
bootstrap.save_routing(this->pid, devices[sel_index - 1]);
806-
}
807-
catch(std::wstring err)
808-
{
809-
app_inject::clear_devices(devices);
810-
this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR);
811-
return 0;
812-
}
813-
app_inject::clear_devices(devices);
814-
815-
dialog_main& main = this->parent.parent;
816-
for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin();
817-
it != main.dialog_arrays.end();
818-
it++)
819-
{
820-
for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin();
821-
jt != (*it)->dialog_controls.end();
822-
jt++)
823-
{
824-
(*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device());
825-
(*jt)->update_attributes();
826-
}
827-
}
828-
829-
this->MessageBoxW(L"Routing saved. Restart the application for the new settings " \
830-
L"to take effect.",
831-
L"Success", MB_ICONINFORMATION);
832-
}
833-
else if(sel_index == 0)
834-
this->MessageBoxW(L"You cannot save routing to the default device!",
835-
NULL, MB_ICONERROR);
836-
837-
return 0;
838-
}
839-
840-
841-
LRESULT dialog_control::OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
842-
{
843-
bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
844-
845-
if(this->MessageBoxW(
846-
L"This will delete all the saved routings for this application. It won't " \
847-
L"delete the routings for any other application. Proceed?",
848-
L"Confirmation for Delete All", MB_OKCANCEL | MB_ICONWARNING) != IDOK)
849-
return 0;
850-
851-
try
852-
{
853-
if(!bootstrap.delete_all(this->pid))
854-
{
855-
this->MessageBoxW(
856-
L"This application doesn't have any saved routings.", NULL, MB_ICONERROR);
857-
return 0;
858-
}
859-
}
860-
catch(std::wstring err)
861-
{
862-
this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR);
863-
return 0;
864-
}
865-
866-
dialog_main& main = this->parent.parent;
867-
for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin();
868-
it != main.dialog_arrays.end();
869-
it++)
870-
{
871-
for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin();
872-
jt != (*it)->dialog_controls.end();
873-
jt++)
874-
{
875-
(*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device());
876-
(*jt)->update_attributes();
877-
}
878-
}
879-
880-
this->MessageBoxW(L"Saved routings for this application deleted. Restart " \
881-
L"the application for the new settings to take effect.",
882-
L"Success", MB_ICONINFORMATION);
883-
884-
return 0;
885-
}
784+
//LRESULT dialog_control::OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
785+
//{
786+
// if(this->MessageBoxW(
787+
// L"This will add a new saved routing for this application. It will not " \
788+
// L"replace the old saved routings for this application. Do you wish to continue?",
789+
// L"Confirmation for Save", MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
790+
// return 0;
791+
//
792+
// bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
793+
//
794+
// input_dialog input_dlg(2);
795+
// input_dlg.DoModal(*this);
796+
// if(IsBadReadPtr(this, sizeof(dialog_control)))
797+
// return 0;
798+
// const int sel_index = input_dlg.selected_index;
799+
// if(sel_index > 0)
800+
// {
801+
// app_inject::devices_t devices;
802+
// app_inject::get_devices(devices);
803+
// try
804+
// {
805+
// bootstrap.save_routing(this->pid, devices[sel_index - 1]);
806+
// }
807+
// catch(std::wstring err)
808+
// {
809+
// app_inject::clear_devices(devices);
810+
// this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR);
811+
// return 0;
812+
// }
813+
// app_inject::clear_devices(devices);
814+
//
815+
// dialog_main& main = this->parent.parent;
816+
// for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin();
817+
// it != main.dialog_arrays.end();
818+
// it++)
819+
// {
820+
// for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin();
821+
// jt != (*it)->dialog_controls.end();
822+
// jt++)
823+
// {
824+
// (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device());
825+
// (*jt)->update_attributes();
826+
// }
827+
// }
828+
//
829+
// this->MessageBoxW(L"Routing saved. Restart the application for the new settings " \
830+
// L"to take effect.",
831+
// L"Success", MB_ICONINFORMATION);
832+
// }
833+
// else if(sel_index == 0)
834+
// this->MessageBoxW(L"You cannot save routing to the default device!",
835+
// NULL, MB_ICONERROR);
836+
//
837+
// return 0;
838+
//}
839+
840+
841+
//LRESULT dialog_control::OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
842+
//{
843+
// bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
844+
//
845+
// if(this->MessageBoxW(
846+
// L"This will delete all the saved routings for this application. It won't " \
847+
// L"delete the routings for any other application. Proceed?",
848+
// L"Confirmation for Delete All", MB_OKCANCEL | MB_ICONWARNING) != IDOK)
849+
// return 0;
850+
//
851+
// try
852+
// {
853+
// if(!bootstrap.delete_all(this->pid))
854+
// {
855+
// this->MessageBoxW(
856+
// L"This application doesn't have any saved routings.", NULL, MB_ICONERROR);
857+
// return 0;
858+
// }
859+
// }
860+
// catch(std::wstring err)
861+
// {
862+
// this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR);
863+
// return 0;
864+
// }
865+
//
866+
// dialog_main& main = this->parent.parent;
867+
// for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin();
868+
// it != main.dialog_arrays.end();
869+
// it++)
870+
// {
871+
// for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin();
872+
// jt != (*it)->dialog_controls.end();
873+
// jt++)
874+
// {
875+
// (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device());
876+
// (*jt)->update_attributes();
877+
// }
878+
// }
879+
//
880+
// this->MessageBoxW(L"Saved routings for this application deleted. Restart " \
881+
// L"the application for the new settings to take effect.",
882+
// L"Success", MB_ICONINFORMATION);
883+
//
884+
// return 0;
885+
//}

audio-router-gui/dialog_control.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class dialog_control : public CDialogImpl<dialog_control>, public COwnerDraw<dia
116116
COMMAND_ID_HANDLER(ID_POPUP_DUPLICATE, OnPopupDuplicate)
117117
MESSAGE_HANDLER(WM_TIMER, OnTimer)
118118
CHAIN_MSG_MAP_MEMBER(ctrl_slider)
119-
COMMAND_ID_HANDLER(ID_SAVEDROUTINGS_SAVEROUTINGFORTHISAPP, OnPopUpSave)
120-
COMMAND_ID_HANDLER(ID_SAVEDROUTINGS_DELETEALLROUTINGSFORTHISAPP, OnPopUpDelete)
119+
/*COMMAND_ID_HANDLER(ID_SAVEDROUTINGS_SAVEROUTINGFORTHISAPP, OnPopUpSave)
120+
COMMAND_ID_HANDLER(ID_SAVEDROUTINGS_DELETEALLROUTINGSFORTHISAPP, OnPopUpDelete)*/
121121
END_MSG_MAP()
122122

123123
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
@@ -131,6 +131,6 @@ class dialog_control : public CDialogImpl<dialog_control>, public COwnerDraw<dia
131131
void DrawItem(LPDRAWITEMSTRUCT);
132132
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
133133
LRESULT OnPopUpSaveRouting(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
134-
LRESULT OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
135-
LRESULT OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
134+
//LRESULT OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
135+
//LRESULT OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
136136
};

audio-router-gui/main.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,20 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
105105
}
106106

107107
MSG msg = {0};
108-
std::unique_ptr<bootstrapper> bootstrap;
109-
try
108+
//std::unique_ptr<bootstrapper> bootstrap;
109+
//try
110+
//{
111+
// // TODO: decide if create a dummy bootstapper in case if the initialization fails
112+
// bootstrap.reset(new bootstrapper);
113+
//}
114+
//catch(std::wstring err)
115+
//{
116+
// err += L"Audio Router will close.";
117+
// MessageBox(NULL, err.c_str(), NULL, MB_ICONERROR);
118+
// goto cleanup;
119+
//}
110120
{
111-
// TODO: decide if create a dummy bootstapper in case if the initialization fails
112-
bootstrap.reset(new bootstrapper);
113-
}
114-
catch(std::wstring err)
115-
{
116-
err += L"Audio Router will close.";
117-
MessageBox(NULL, err.c_str(), NULL, MB_ICONERROR);
118-
goto cleanup;
119-
}
120-
{
121-
window win(bootstrap.get());
121+
window win/*(bootstrap.get())*/;
122122
RECT r = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT + WIN_WIDTH, CW_USEDEFAULT + WIN_HEIGHT};
123123
if(win.CreateEx(NULL, &r) == NULL)
124124
{

audio-router-gui/window.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
telemetry* telemetry_m = NULL;
44

5-
window::window(bootstrapper* bootstrap) : dlg_main_b(true), license(NULL), bootstrap(bootstrap)
5+
window::window(/*bootstrapper* bootstrap*/) : dlg_main_b(true)/*, license(NULL)*//*, bootstrap(bootstrap)*/
66
{
77
this->dlg_main = new dialog_main(*this);
88
this->form_view = new formview(*this);
@@ -22,7 +22,7 @@ int window::OnCreate(LPCREATESTRUCT lpcs)
2222
{
2323
telemetry_m = new telemetry;
2424

25-
this->license = new dialog_licensing(*this);
25+
/*this->license = new dialog_licensing(*this);*/
2626

2727
this->m_hWndClient = this->dlg_main->Create(this->m_hWnd);
2828
this->dlg_main->ShowWindow(SW_SHOW);
@@ -78,8 +78,7 @@ LRESULT window::OnFileRefreshlist(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWn
7878
LRESULT window::OnAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
7979
{
8080
this->MessageBoxW(
81-
L"Audio Router test version 0.10.1.\n" \
82-
L"The testing license will expire after 1 June 16 in your local time.\n" \
81+
L"Audio Router version 0.10.2.\n" \
8382
L"\nIf you come across any bugs(especially relating to routing or duplicating), " \
8483
L"or just have an idea for a new feature, " \
8584
L"please send a PM to the developer on reddit: reddit.com/user/audiorouterdev/",

audio-router-gui/window.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class window : public CFrameWindowImpl<window>
1717
public:
1818
dialog_main* dlg_main;
1919
formview* form_view;
20-
dialog_licensing* license;
21-
bootstrapper* bootstrap;
20+
/*dialog_licensing* license;*/
21+
/*bootstrapper* bootstrap;*/
2222

23-
explicit window(bootstrapper*);
23+
explicit window(/*bootstrapper**/);
2424
~window();
2525

2626
DECLARE_FRAME_WND_CLASS(L"Audio Router", IDR_MAINFRAME);

0 commit comments

Comments
 (0)