Initial dockapps git repo
[dockapps.git] / wmmixer-1.5 / wmmixer.h
blob2e0968ef86860b4b7c05e2e60d9529d319beb5b4
1 // wmmixer.h - A mixer designed for WindowMaker
2 //
3 // Release 1.5
4 // Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
5 // Copyright (C) 2002 Gordon Fraser <gordon@debian.org>
6 // This software comes with ABSOLUTELY NO WARRANTY
7 // This software is free software, and you are welcome to redistribute it
8 // under certain conditions
9 // See the COPYING file for details.
12 #ifndef __wmmixer_h__
13 #define __wmmixer_h_
15 // Input/Output
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <string.h>
19 #include <unistd.h>
20 #include <getopt.h>
22 #include <iostream>
24 #include <X11/X.h>
26 // WMMixer
27 #include "mixctl.h"
28 #include "xhandler.h"
29 #include "common.h"
30 #include "exception.h"
32 // For repeating next and prev buttons
33 #define RPTINTERVAL 5
36 class WMMixer
38 protected:
40 // Mixer
41 MixCtl *mixctl_;
43 char mixer_device_[256];
44 unsigned num_channels_;
45 unsigned current_channel_;
46 unsigned current_channel_left_;
47 unsigned current_channel_right_;
48 bool current_recording_;
49 bool current_show_recording_;
51 XHandler *xhandler_;
53 unsigned *channel_list_;
55 int repeat_timer_;
57 // For draggable volume control
58 bool dragging_;
59 // Default scroll amount
60 int wheel_scroll_;
62 // Input/Output
63 void readConfigurationFile();
64 void displayVersion(void);
65 void displayUsage(const char*);
66 void checkVol(bool);
68 void motionEvent(XMotionEvent *xev);
69 void releaseEvent(XButtonEvent *xev);
70 void pressEvent(XButtonEvent *xev);
71 void parseArgs(int , char **);
73 void initMixer();
74 void initXHandler();
76 void updateDisplay();
78 public:
79 WMMixer();
80 ~WMMixer();
82 void init(int, char **);
83 void loop();
87 #endif //__wmmixer_h__