wmshutdown: Update manpage
[dockapps.git] / AlsaMixer.app / Mixer.h
blob6e226a3c49d95f65023794edd4f35bfb29c15422
1 //
2 // Mixer.app / AlsaMixer.app
3 //
4 // Copyright (c) 1998-2002 Per Liden
5 // Copyright (C) 2004, Petr Hlavka
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
20 // USA.
23 #ifndef _MIXER_H_
24 #define _MIXER_H_
26 #include "AMixer/AMixer.h"
28 #include <X11/Xlib.h>
30 #define APPNAME "AlsaMixer.app"
31 #define VERSION "1.8.0"
32 #define INSTANCENAME "alsamixer_app"
33 #define CLASSNAME "AlsaMixer_app"
34 #define SETTINGS "/GNUstep/Defaults/AlsaMixer"
35 #define MAX_COMMAND_LENGTH 512
37 #define LABEL_X 4
38 #define LABEL_Y 54
39 #define LABEL_FONT "-*-helvetica-medium-r-*-*-8-*-*-*-*-*-*-*"
41 #define LED_X 57
42 #define LED_Y 59
43 #define BUTTON_MIN 45
44 #define BUTTON_MAX 6
46 class Mixer
48 public:
49 Mixer(int argc, char** argv);
50 ~Mixer() {};
51 void run();
52 void saveVolumeSettings();
54 private:
55 void tryHelp(char* appname);
56 void showHelp();
57 void checkArgument(char** argv, int argc, int index);
58 void showErrorLed();
59 void findMixerDevice();
60 void getVolume();
61 void setVolume(int button, int volume);
62 void toggleMute(int button);
63 void setButtonType(int button);
64 void setButtonPosition(int button, int position);
65 void setButtonPositionRelative(int button, int relativePosition);
66 void loadVolumeSettings();
68 Display* mDisplay;
69 Window mRoot;
70 Window mAppWin;
71 Window mIconWin;
72 Window mButton[3];
73 char* mMixerDevice;
74 char* mInstanceName;
75 char* mLabelText;
76 char* mSettingsFile;
77 char* mCommand;
78 int mError;
79 int mVolumeSource[3];
80 int mVolume[3];
81 int mVolumePos[3];
82 int mVolumeMute[3];
83 int mWheelButton;
84 bool mSaveSettings;
85 bool mLoadSettings;
86 AMixer* aMixer;
89 #endif