| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 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 |
|
| 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 |
|
| 78 |
|
| 79 |
static freacCommandline *Get(const Array<String> & = Array<String>()); |
| 80 |
|
| 81 |
|
| 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 |