-
Notifications
You must be signed in to change notification settings - Fork 4
/
MainWindow.h
118 lines (98 loc) · 2.3 KB
/
MainWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Copyright 2011-2015. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Author:
* Humdinger, [email protected]
*
* based on ideas of YAVTD for Haiku
* Version 1.0 by Leszek Lesner (C) 2011
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "Settings.h"
#include "WorkerThread.h"
#include <Button.h>
#include <Directory.h>
#include <FilePanel.h>
#include <Menu.h>
#include <MenuBar.h>
#include <MenuItem.h>
#include <String.h>
#include <StringView.h>
#include <TextControl.h>
#include <Window.h>
enum {
statBUFFER = 'buff',
statDOWNLOAD = 'down',
statFINISH_GET = 'gfin',
statFINISH_PLAY = 'pfin',
statFINISH_SAVE = 'sfin',
statFINISH_UPDATE = 'ufin',
statERROR = 'erro',
statPLAYING = 'play',
msgABORT = 'abor',
msgAUTO = 'auto',
msgCLEAN = 'clen',
msgCLEARURL = 'curl',
msgEDIT = 'edit',
msgOPENURL = 'ourl',
msgPLAY = 'ypla',
msgSAVE = 'esav',
msgURL = 'urly',
FOLDER_SELECT_MESSAGE = 'fsel',
SELECT_THIS_DIR_MESSAGE = 'sdir'
};
class MainWindow : public BWindow {
public:
MainWindow();
void MessageReceived(BMessage* msg);
bool QuitRequested();
virtual void FrameResized(float width, float height);
void SetURL(BString* url);
private:
void _BuildMenu();
void _BuildLayout();
status_t WatchMonitoredSitesList();
bool GetClip();
void GetTitle();
BString GetClipboard();
void KillThread(char* command);
void ResetFlags();
void SetStatus(BString text);
void TruncateTitle();
void URLofFile(entry_ref &ref);
void PlayClip();
void SaveClip();
private:
BButton* fAbortButton;
BButton* fPlayButton;
BButton* fSaveButton;
BFilePanel* fSaveFilePanel;
BMenuBar* fMenuBar;
BMenuItem* fAbortMenu;
BMenuItem* fAutoMenu;
BMenuItem* fCleanMenu;
BMenuItem* fPlayMenu;
BMenuItem* fSaveMenu;
BMenuItem* fClearURLMenu;
BMenuItem* fOpenURLMenu;
BString fClipTitle;
BString* fFilename;
BString* fSaveDir;
BString* fTempDir;
BString* fURL;
BStringView* fStatusView;
BStringView* fTitleView;
BTextControl* fURLBox;
bool fAbortedFlag;
bool fGetFlag;
bool fGotClipFlag;
bool fPlayedFlag;
bool fPlayingFlag;
bool fSavedFlag;
bool fSaveIt;
Settings fSettings;
WorkerThread* fWorkerThread;
};
#endif /* MAINWINDOW_H */