Debian Codegraph @

include/startconsole.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_CMDMAIN
14 #define H_FREAC_CMDMAIN
15
16 #include <smooth.h>
17 #include <boca.h>
18
19 #include "freac.h"
20
21 #include "engine/converter.h"
22
23 #ifdef __WIN32__
24 # define DLLEXPORT __declspec (dllexport)
25 #else
26 # define DLLEXPORT __attribute__ ((visibility ("default")))
27 #endif
28
29 using namespace smooth;
30 using namespace smooth::GUI;
31
32 extern "C"
33 {
34 Int DLLEXPORT StartConsole(const Array<String> &);
35 }
36
37 namespace freac
38 {
39 class freacCommandline : public freac
40 {
41 private:
42 /* Singleton class, therefore protected constructor/destructor
43 */
44 freacCommandline(const Array<String> &);
45 ~freacCommandline();
46
47 const Array<String> &args;
48
49 String encoderID;
50 Bool firstFile;
51 Bool stopped;
52 Int errorCode;
53
54 BoCA::Picture coverFront;
55 BoCA::Picture coverBack;
56
57 Bool ScanForProgramOption(const String &, String * = NIL);
58 Bool ScanForEncoderOption(const String &, String * = NIL);
59 Void ScanForFiles(Array<String> *);
60
61 Bool ParamHasArguments(const String &, Bool);
62 Bool TracksToFiles(const String &, Array<String> *);
63
64 String GetAbsolutePathName(const String &path) const;
65
66 BoCA::Picture LoadAlbumArt(const String &, Int);
67
68 Bool AddToJoblist(const Array<String> &, Bool);
69
70 Bool SetConfigDefaults(BoCA::Config *, Bool);
71 Bool SetEncoderDefaults(BoCA::Config *, Bool);
72 public:
73 Void ShowHelp(const String & = NIL);
74
75 Void Stop();
76
77 /* Returns a new or existing instance of freacCommandline
78 */
79 static freacCommandline *Get(const Array<String> & = Array<String>());
80
81 /* Destroys an existing instance of freacCommandline
82 */
83 static Void Free();
84 accessors:
85 Int GetErrorCode() { return errorCode; }
86 slots:
87 Void OnEncodeTrack(const BoCA::Track &, const String &, const String &, ConversionStep);
88 Void OnFinishEncoding(Bool);
89 };
90 };
91
92 #endif