rtoss - Blame information for rev 182

Subversion Repositories:
Rev:
Rev Author Line No. Line
181 roytam 1 /* ----------------------------------------------------------------------------
2  
3     gen_tbar
4     ========
5     Winamp plugin to display customizable data on window captions
6  
7     Copyright (c) 1999-2000 Jos van den Oever (http://www.vandenoever.info/)
8     Copyright (c) 2005 Martin Zuther (http://www.mzuther.de/)
9  
10     This program is free software; you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation; either version 2 of the License, or
13     (at your option) any later version.
14  
15     This program is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     GNU General Public License for more details.
19  
20     You should have received a copy of the GNU General Public License
21     along with this program; if not, write to the Free Software
22     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  
24 -------------------------------------------------------------------------------
25  
26     Notify CD Player
27     ================
28     Copyright (c) 1996-1997 Mats Ljungqvist (mlt@cyberdude.com)
29  
30     StdString
31     =========
32     Copyright (c) 2002 Joseph M. O'Leary.  This code is 100% free.  Use it
33     anywhere you want. Rewrite it, restructure it, whatever.  If you can write
34     software that makes money off of it, good for you.  I kinda like capitalism.
35     Please don't blame me if it causes your $30 billion dollar satellite explode
36     in orbit. If you redistribute it in any form, I'd appreciate it if you would
37     leave this notice here.
38  
39 ---------------------------------------------------------------------------- */
40  
41 #ifndef GEN_TBAR_H
42 #define GEN_TBAR_H
43  
182 roytam 44 #include <TCHAR.H>
181 roytam 45 #include <windows.h>
46 #include "Winamp SDK/wa_ipc.h"
47  
48 #include "titleinfo.h"
49 #include "Help\popup.h"
50 #include <htmlhelp.h>
51 #include <Shlwapi.h>
52  
53 #define SEARCH_CAPTION_TEXT  64
54 #define TITLE_MASK_TEXT     128
55 #define TEXTLENGTH          512
56  
57 VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
58  
59 class gen_tbar
60 {
61 public:
62         gen_tbar(HINSTANCE h_dll_instance, HWND hwnd_parent, CStdString help_file, CStdString plugin_version);
63         ~gen_tbar();
64  
65         void config();
66         void draw_titlebar();
67         bool enabled() { return plugin_enabled; }
68  
69         bool gen_tbar::config_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
70  
71 protected:
72         bool get_song_data();
73  
182 roytam 74         bool get_registry_string(HKEY root_key, TCHAR* sub_key, TCHAR* key_name, TCHAR** data);
75         bool set_registry_string(HKEY root_key, TCHAR* sub_key, TCHAR* key_name, TCHAR* data);
181 roytam 76  
77         UINT uTimerID;
78  
79         HINSTANCE hDllInstance; // plugin data
80         HWND hWndParent;                // plugin data
81  
82         TitleInfo* pInfo;
83  
84         LOGFONT lfont;
85         LOGFONT lfont_old;
86  
87         int winamp_version;
88         int verticalshift;
89         int verticalshift_old;
90         int horizontalshift;
91         int horizontalshift_old;
92  
93         DWORD color;
94         DWORD color_old;
95  
182 roytam 96         TCHAR* data;
181 roytam 97  
98         CStdString strHelpFile;
99         CStdString strSearchCaption;
100         CStdString strVersion;
101  
102     CStdString strTime;
103     CStdString strTitle;
104     CStdString strTitleMask;
105     CStdString strTitleMaskOld;
106  
107         bool plugin_enabled;
108         bool plugin_enabled_old;
109         bool show_remaining_time;
110         bool show_remaining_time_old;
111         bool show_song_length;
112         bool show_song_length_old;
113         bool show_playstatus;
114         bool show_playstatus_old;
115 };
116  
117 BOOL CALLBACK ConfigProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
118  
119 static DWORD id_array[] =
120 {
121         IDOK,                    IDH_OK,
122         IDCANCEL,                IDH_CANCEL,
123         IDC_SHOW_REMAINING_TIME, IDH_SHOW_REMAINING_TIME,
124         IDC_SHOW_SONG_LENGTH,    IDH_SHOW_SONG_LENGTH,
125         IDC_CHOOSE_FONT,         IDH_CHOOSE_FONT,
126         IDC_SHOW_PLAYSTATUS,     IDH_SHOW_PLAYSTATUS,
127         IDC_GET_HELP,            IDH_GET_HELP,
128         IDC_ABOUT,               IDH_ABOUT,
129         IDC_HSPIN,               IDH_HSPIN,
130         IDC_HEDIT,               IDH_HEDIT,
131         IDC_VEDIT,               IDH_VEDIT,
132         IDC_VSPIN,               IDH_VSPIN,
133         IDC_SEARCH_CAPTION,      IDH_SEARCH_CAPTION,
134         IDC_PLUGIN_ENABLED,      IDH_PLUGIN_ENABLED,
135         IDC_TITLE_MASK,          IDH_TITLE_MASK,
136         IDC_TITLE_MASK_RESET,    IDH_TITLE_MASK_RESET,
137         0, 0
138 };
139  
140 #endif // GEN_TBAR_H