Debian Codegraph @

include/dialogs/splitter.h

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2023 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #ifndef H_FREAC_DIALOG_SPLITTER
14 #define H_FREAC_DIALOG_SPLITTER
15
16 #include <smooth.h>
17 #include <boca.h>
18
19 #include "../jobs/job.h"
20
21 using namespace smooth;
22 using namespace smooth::GUI;
23
24 namespace freac
25 {
26 enum SplitMode
27 {
28 SplitModeTime,
29 SplitModeParts,
30 SplitModeMetadata
31 };
32
33 class RepeatPreviousPartComponent;
34
35 class DialogSplitter : public Dialogs::Dialog
36 {
37 private:
38 Divider *divbar;
39
40 Window *mainWnd;
41 Titlebar *mainWnd_titlebar;
42
43 Text *text_tracks;
44
45 Button *button_select_all;
46 Button *button_select_none;
47 Button *button_select_toggle;
48
49 ListBox *list_tracks;
50 ListBox *list_result;
51
52 Progressbar *progress_length;
53
54 GroupBox *group_mode;
55 OptionBox *option_mode_time;
56 OptionBox *option_mode_parts;
57 OptionBox *option_mode_silence;
58 OptionBox *option_mode_metadata;
59
60 GroupBox *group_time;
61 Text *text_time;
62 ComboBox *combo_time_mode;
63 ComboBox *combo_time_exact;
64 EditBox *edit_time_value;
65 Arrows *arrows_time_value;
66 ComboBox *combo_time_unit;
67 CheckBox *check_time_tracks;
68 RepeatPreviousPartComponent *repeat_time;
69
70 GroupBox *group_parts;
71 Text *text_parts;
72 EditBox *edit_parts;
73 Arrows *arrows_parts;
74 CheckBox *check_parts_tracks;
75 RepeatPreviousPartComponent *repeat_parts;
76
77 GroupBox *group_metadata;
78 Text *text_metadata;
79 EditBox *edit_metadata;
80 List *list_metadata_defaults;
81 ListBox *list_metadata_placeholders;
82 RepeatPreviousPartComponent *repeat_metadata;
83
84 GroupBox *group_filename;
85 Text *text_filename;
86 EditBox *edit_filename;
87 List *list_filename;
88 CheckBox *check_append_number;
89
90 Button *button_cancel;
91 Button *button_save;
92 Button *button_convert;
93
94 Bool disableUpdates;
95
96 Int splitMode;
97 Bool splitAtTracks;
98
99 Int partDuration;
100 Int numberOfParts;
101
102 Bool repeatEnd;
103 Int repeatSeconds;
104
105 Bool appendNumber;
106
107 Array<BoCA::Track> joblistTracks;
108 Array<Array<BoCA::Track> > resultTrackLists;
109
110 Threads::Thread *updateTrackLengthsThread;
111 Bool updateTrackLengthsRunning;
112 Bool cancelUpdateTrackLengths;
113
114 Void SaveSettings();
115
116 String GetJoblistEntryString(const BoCA::Track &) const;
117 String GetResultEntryString(const BoCA::Track &) const;
118
119 Int64 GetTrackDuration(const BoCA::Track &, Int) const;
120
121 Bool SortsAfter(const String &, const String &) const;
122
123 Void UpdateTrackLengths();
124
125 Void AddPreviousPartRepeat(Array<BoCA::Track> &, Int64 &, Int) const;
126
127 const BoCA::Track &GetIdentifyingTrack(const Array<BoCA::Track> &, Bool) const;
128 public:
129 DialogSplitter(const Array<BoCA::Track> &);
130 ~DialogSplitter();
131
132 const Error &ShowDialog();
133 slots:
134 Void OnChangeSize(const Size &);
135
136 Void SelectAll();
137 Void SelectNone();
138 Void ToggleSelection();
139
140 Void OnMarkEntry(ListEntry *);
141 Void OnClickTab(Int);
142
143 Void OnSelectMode();
144 Void OnToggleSplitAtTracks();
145
146 Void OnEditDuration();
147 Void OnChangeDuration();
148
149 Void OnEditParts();
150 Void OnChangeParts();
151
152 Void OnToggleRepeatEnd(Bool);
153 Void OnChangeRepeatDuration(Int);
154
155 Void OnChangeSeconds();
156
157 Void OnEditMetadataString();
158 Void OnToggleMetadataEntry();
159
160 Void OnEditFilenamePattern();
161 Void OnToggleAppendNumber();
162
163 Void OnChangeConfiguration();
164
165 Void OnConvert();
166 Void OnSave();
167 Void OnCancel();
168 };
169 };
170
171 #endif