Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/malensek/3RVX
Browse files Browse the repository at this point in the history
  • Loading branch information
malensek committed Feb 20, 2015
2 parents ed11d4e + 970fa92 commit ded4677
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 23 deletions.
3 changes: 1 addition & 2 deletions 3RVX/3RVX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ LRESULT CALLBACK WndProc(
break;

case MSG_SETTINGS:
CLOG(L"Launching settings editor");
/* TODO: launch! */
Settings::LaunchSettingsApp();
break;

case MSG_HIDEOSD:
Expand Down
5 changes: 2 additions & 3 deletions 3RVX/3RVX.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<AdditionalDependencies>Wtsapi32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>robocopy /MIR /XO /NP "$(ProjectDir)Skins" "$(TargetDir)\Skins" 2&gt;&amp;1 || exit /B 0</Command>
<Command>mklink /j "$(TargetDir)\Skins" "$(ProjectDir)Skins" || exit /B 0</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -73,8 +73,7 @@
<AdditionalDependencies>Wtsapi32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
</Command>
<Command>mklink /j "$(TargetDir)\Skins" "$(ProjectDir)Skins" || exit /B 0</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions 3RVX/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define GENERR (0x1 << 7)
#define SKINERR (GENERR << 8)

#define GENERR_NOTFOUND GENERR + 1

#define SKINERR_INVALID_SKIN SKINERR + 1
#define SKINERR_INVALID_OSD SKINERR + 2
#define SKINERR_INVALID_METER SKINERR + 3
Expand Down
3 changes: 1 addition & 2 deletions 3RVX/OSD/EjectOSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ OSD(L"3RVX-EjectDispatcher") {
Gdiplus::Bitmap *bg = skin->OSDBgImg("eject");
_mWnd->BackgroundImage(bg);
_mWnd->Update();

_mWnd->VisibleDuration(800);
_mWnd->VisibleDuration(Settings::Instance()->HideDelay());

HMONITOR monitor = Monitor::Primary();
PositionWindow(monitor, *_mWnd);
Expand Down
19 changes: 13 additions & 6 deletions 3RVX/OSD/VolumeOSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ _muteWnd(L"3RVX-MasterMuteOSD", L"3RVX-MasterMuteOSD")

UpdateDeviceMenu();

Settings *settings = Settings::Instance();
FadeOut *fOut = new FadeOut();
_mWnd.HideAnimation(fOut);
_mWnd.VisibleDuration(800);
_mWnd.VisibleDuration(settings->HideDelay());
_muteWnd.HideAnimation(fOut);
_muteWnd.VisibleDuration(800);
_muteWnd.VisibleDuration(settings->HideDelay());

UpdateIcon();
float v = _volumeCtrl->Volume();
Expand Down Expand Up @@ -174,16 +175,24 @@ void VolumeOSD::UpdateIconTip() {
}
}

void VolumeOSD::UnMute() {
if (_volumeCtrl->Muted() == true) {
_volumeCtrl->Muted(false);
}
}

void VolumeOSD::ProcessHotkeys(HotkeyInfo &hki) {
float currentVol = _volumeCtrl->Volume();
switch (hki.action) {
case HotkeyInfo::IncreaseVolume:
UnMute();
_volumeCtrl->Volume(currentVol + _defaultIncrement);
SendMessage(_hWnd, MSG_VOL_CHNG, NULL, NULL);
break;

case HotkeyInfo::DecreaseVolume:
_volumeCtrl->Volume(currentVol - _defaultIncrement);
UnMute();
_volumeCtrl->Volume(currentVol - _defaultIncrement - 0.0001f);
SendMessage(_hWnd, MSG_VOL_CHNG, NULL, NULL);
break;

Expand Down Expand Up @@ -239,9 +248,7 @@ VolumeOSD::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
int menuItem = LOWORD(wParam);
switch (menuItem) {
case MENU_SETTINGS:
CLOG(L"Opening Settings App: %s", Settings::SettingsApp().c_str());
ShellExecute(NULL, L"open",
Settings::SettingsApp().c_str(), NULL, NULL, SW_SHOWNORMAL);
Settings::LaunchSettingsApp();
break;

case MENU_MIXER: {
Expand Down
1 change: 1 addition & 0 deletions 3RVX/OSD/VolumeOSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class VolumeOSD : public OSD {
void UpdateIconImage();
void UpdateIconTip();
void UpdateDeviceMenu();
void UnMute();

virtual LRESULT
WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
Expand Down
17 changes: 13 additions & 4 deletions 3RVX/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Shlwapi.h>
#include <algorithm>

#include "Error.h"
#include "HotkeyActions.h"
#include "HotkeyInfo.h"
#include "Logger.h"
Expand Down Expand Up @@ -42,10 +43,6 @@ std::vector<std::wstring> Settings::HideAnimNames = {
L"fade"
};

Settings::Settings() {

}

Settings *Settings::Instance() {
if (instance == NULL) {
instance = new Settings();
Expand Down Expand Up @@ -107,6 +104,18 @@ std::wstring Settings::LanguagesDir() {
return AppDir() + L"\\" + LANG_DIR;
}

void Settings::LaunchSettingsApp() {
std::wstring app = SettingsApp();

CLOG(L"Opening Settings App: %s", app.c_str());
int exec = (int) ShellExecute(
NULL, L"open", app.c_str(), NULL, NULL, SW_SHOWNORMAL);

if (exec <= 32) {
Error::ErrorMessage(GENERR_NOTFOUND, app);
}
}

std::wstring Settings::AudioDeviceID() {
return GetText(XML_AUDIODEV);
}
Expand Down
5 changes: 4 additions & 1 deletion 3RVX/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Settings {
static std::wstring AppDir();
static std::wstring SkinDir();
static std::wstring SettingsApp();
static void LaunchSettingsApp();

std::wstring AudioDeviceID();

Expand Down Expand Up @@ -88,7 +89,9 @@ class Settings {
void Hotkeys(std::vector<HotkeyInfo> hotkeys);

private:
Settings();
Settings() {

}

static Settings *instance;
static std::wstring _appDir;
Expand Down
File renamed without changes
10 changes: 5 additions & 5 deletions 3RVX/skins/Classic/skin.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<skin>
<info>
<author></author>
<website></website>
<author>Steve Jobs</author>
<website>http://www.apple.com</website>
</info>

<osds>
<volume background="OSD\volume_bg.png">
<volume background="OSD\volume.png" defaultUnits="16">
<meter type="HorizontalBar" image="OSD\meter.png"
x="33" y="165" units="16"/>
<iconset location="Icons\Volume"/>
Expand All @@ -17,8 +17,8 @@
</osds>

<sliders>
<volume background="Slider/background.png">
<slider type="vertical" image="Slider/knob.png"
<volume background="Slider\background.png">
<slider type="vertical" image="Slider\knob.png"
x="32" y="20" width="5" height="98"/>
</volume>
</sliders>
Expand Down
6 changes: 6 additions & 0 deletions SettingsUI/SettingsUI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<PostBuildEvent>
<Command>mklink /j "$(TargetDir)\Skins" "$(ProjectDir)Skins" || exit /B 0</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand Down Expand Up @@ -102,6 +105,9 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<PostBuildEvent>
<Command>mklink /j "$(TargetDir)\Skins" "$(ProjectDir)Skins" || exit /B 0</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\3RVX\HotkeyInfo.h" />
Expand Down

0 comments on commit ded4677

Please sign in to comment.