-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathiBroadcast.dpr
132 lines (106 loc) · 3.17 KB
/
iBroadcast.dpr
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
program iBroadcast;
{$R *.dres}
uses
Vcl.Forms,
Cod.Instances,
Cod.SysUtils,
Cod.Dialogs,
MainUI in 'MainUI.pas' {UIForm},
BroadcastAPI in 'BroadcastAPI.pas',
SpectrumVis3D in 'Utils\SpectrumVis3D.pas',
iBroadcastUtils in 'Utils\iBroadcastUtils.pas',
DebugForm in 'Forms\DebugForm.pas' {DebugUI},
VolumePopup in 'Forms\VolumePopup.pas' {VolumePop},
Performance in 'Forms\Performance.pas' {PerfForm},
MiniPlay in 'Forms\MiniPlay.pas' {MiniPlayer},
InfoForm in 'Forms\InfoForm.pas' {InfoBox},
HelpForm in 'Forms\HelpForm.pas' {HelpUI},
NewVersionForm in 'Forms\NewVersionForm.pas' {NewVersion},
CreatePlaylistForm in 'Forms\CreatePlaylistForm.pas' {CreatePlaylist},
Offline in 'Forms\Offline.pas' {OfflineForm},
PickerDialogForm in 'Forms\PickerDialogForm.pas' {PickerDialog},
RatingPopup in 'Forms\RatingPopup.pas' {RatingPopupForm},
CodeSources in 'Forms\CodeSources.pas' {SourceUI},
LoggingForm in 'Forms\LoggingForm.pas' {Logging};
{$R *.res}
var
I: integer;
Param: string;
begin
Application.Initialize;
// Close if Other instance
SetSemaphore(APP_USERMODELID); // use application app user model ID
InitializeInstance(true, false);
if HasOtherInstance then begin
SendOtherWindowMessageAuto(WM_RESTOREMAINWINDOW, 0, 0);
BringOtherWindowToTopAuto;
Halt( 1 );
end;
{Application.CreateForm(TCreatePlaylist, CreatePlaylist);
Application.Run; }
// Initiate Default
AllowDebug := false;
EnableLogging := false;
// Parameter String
for I := 1 to ParamCount do
begin
Param := GetParameter(I);
if Param = '-debug' then
AllowDebug := true;
if Param = '-offline' then
begin
OverrideOffline := true;
end;
if Param = '-tray' then
begin
Application.ShowMainForm := false;
HiddenToTray := true;
end;
if Param = '-logging' then
EnableLogging := true;
if Param = '-logtoken' then
PrivacyEnabled := false;
if Param = '-exportpost' then
ExportPost := true;
if Param = '-log32' then
EnableLog32 := true;
end;
AddToLog('======================');
AddToLog('Started iBroadcast version ' + VERSION.ToString);
AddToLog('Started creating forms');
Application.MainFormOnTaskbar := True;
Application.CreateForm(TUIForm, UIForm);
Application.CreateForm(TMiniPlayer, MiniPlayer);
Application.CreateForm(TInfoBox, InfoBox);
// Write instance data (use try, just to be on the safe side)
try
PutAppInfo( Application.MainForm.Handle );
except
end;
// Log
if EnableLog32 then
begin
Application.CreateForm(TLogging, Logging);
Logging.Show;
AddToLog('Created log form');
end;
// Debug
AddToLog('Checking debug mode');
if AllowDebug then
begin
// Debug form
DebugUI := TDebugUI.Create(Application);
DebugUI.Show;
DebugUi.DataSync.Enabled := true;
// UI
with UIForm do
begin
CopyID1.Visible := true;
CopyID2.Visible := true;
CopyID3.Visible := true;
CopyID4.Visible := true;
end;
end;
AddToLog('Executing Application');
Application.Run;
end.