Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ccextractor
Binary file not shown.
Binary file modified ccextractorwinfull.exe
Binary file not shown.
124 changes: 62 additions & 62 deletions lib/models/settings_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,80 +223,80 @@ class SettingsModel {

static Map<String, String> get paramsLookUpMap {
return {
'out': '-out=',
'inp': '-in=',
'out': '--out=',
'inp': '--input=',
'outputfilename': '-o',
'fixptsjumps': '-fixptsjumps',
'fixptsjumps': '--fixptsjumps',
'append': '--append',
'service': '--service',
'outInterval': '--outinterval',
'segmentonkeyonly': '--segmentonkeyonly',
'goptime': '--goptime',
'nogoptime': '--nogoptime',
'nogoptime': '--no-goptime',
'fixpadding': '--fixpadding',
'freqEs15': '-90090',
'freqEs15': '--90090',
'stream': '--stream',
'videoedited': '--videoedited',
'usepicorder': '--usepicorder',
'myth': '-myth',
'nomyth': '-nomyth',
'wtvconvertfix': '-wtvconvertfix',
'wtvmpeg2': '-wtvmpeg2',
'myth': '--myth',
'nomyth': '--no-myth',
'wtvconvertfix': '--wtvconvertfix',
'wtvmpeg2': '--wtvmpeg2',
'program_number': '--program-number',
'autoprogram': '-autoprogram',
'multiprogram': '-multiprogram',
'streamtype': '-streamtype',
'autoprogram': '--autoprogram',
'multiprogram': '--multiprogram',
'streamtype': '--streamtype',
'hauppauge': '--hauppauge',
'mp4vidtrack': '-mp4vidtrack',
'noautotimeref': '-noautotimeref',
'noscte20': '--noscte20',
'mp4vidtrack': '--mp4vidtrack',
'noautotimeref': '--no-autotimeref',
'noscte20': '--no-scte20',
'webvttcss': '--webvtt-create-css',
'analyzevideo': '--analyzevideo',
'notimestamp': '--no-timestamp-map',
'nolevdist': '-nolevdist',
'minlevdist': '-levdistmincnt',
'maxlevdist': '-levdistmaxpct',
'chapters': '-chapters',
'bom': '-bom',
'nobom': '-nobom',
'nofontcolor': '--nofontcolor',
'nohtmlescape': '--nohtmlescape',
'notypesetting': '--notypesetting',
'trim': '-trim',
'nolevdist': '--no-levdist',
'minlevdist': '--levdistmincnt',
'maxlevdist': '--levdistmaxpct',
'chapters': '--chapters',
'bom': '--bom',
'nobom': '--no-bom',
'nofontcolor': '--no-fontcolor',
'nohtmlescape': '--no-htmlescape',
'notypesetting': '--no-typesetting',
'trim': '--trim',
'defaultcolor': '--defaultcolor',
'sentencecap': '--sentencecap',
'capFile': '--capfile',
'kf': '--kf',
'profanityFile': '--profanity-file',
'splitbysentence': '--splitbysentence',
'datets': '-datets',
'sects': '-sects',
'latrusmap': '-latrusmap',
'xds': '=xds',
'lf': '-lf',
'df': '-df',
'autodash': '- autodash',
'xmltv': '-xmltv',
'xmltvliveinterval': '-xmltvliveinterval',
'xmltvoutputinterval': '-xmltvoutputinterval',
'xmltvonlycurrent': '-xmltvonlycurrent',
'sem': '-sem',
'dvblang': '-dvblang',
'ocrlang': '-ocrlang',
'mkvlang': '-mkvlang',
'quant': '-quant',
'oem': '-oem',
'datets': '--datets',
'sects': '--sects',
'latrusmap': '--latrusmap',
'xds': '--xds',
'lf': '--lf',
'df': '--df',
'autodash': '--autodash',
'xmltv': '--xmltv',
'xmltvliveinterval': '--xmltvliveinterval',
'xmltvoutputinterval': '--xmltvoutputinterval',
'xmltvonlycurrent': '--xmltvonlycurrent',
'sem': '--sem',
'dvblang': '--dvblang',
'ocrlang': '--ocrlang',
'mkvlang': '--mkvlang',
'quant': '--quant',
'oem': '--oem',
'bufferinput': '--bufferinput',
'nobufferinput': '-nobufferinput',
'nobufferinput': '--no-bufferinput',
'buffersize': '--buffersize',
'koc': '-koc',
'dru': '-dru',
'norollup': '--norollup',
'delay': '-delay',
'startat': '-startat',
'endat': '-endat',
'codec': '-codec',
'nocodec': 'nocodec',
'koc': '--koc',
'dru': '--dru',
'norollup': '--no-rollup',
'delay': '--delay',
'startat': '--startat',
'endat': '--endat',
'codec': '--codec',
'nocodec': '--no-codec',
'startcreditstext': '--startcreditstext',
'startcreditsnotbefore': '--startcreditsnotbefore',
'startcreditsnotafter': '--startcreditsnotafter',
Expand All @@ -305,17 +305,17 @@ class SettingsModel {
'endcreditstext': '--endcreditstext',
'endcreditsforatleast': '--endcreditsforatleast',
'endcreditsforatmost': '--endcreditsforatmost',
'tpage': '-tpage',
'teletext': '-teletext',
'noteletext': '-noteletext',
'hardsubx': '-hardsubx',
'tickertext': '-tickertext',
'ocrMode': '-ocr_mode',
'subcolor': '-subcolor',
'minSubDuration': '-min_sub_duration',
'detectItalics': '-detect_italics',
'confThresh': '-conf_thresh',
'whiteThresh': '-whiteness_thresh',
'tpage': '--tpage',
'teletext': '--teletext',
'noteletext': '--no-teletext',
'hardsubx': '--hardsubx',
'tickertext': '--tickertext',
'ocrMode': '--ocr-mode',
'subcolor': '--subcolor',
'minSubDuration': '--min-sub-duration',
'detectItalics': '--detect-italics',
'confThresh': '--conf-thresh',
'whiteThresh': '--whiteness-thresh',
'splitMode': '', // splitMode is not a ccx setting
};
}
Expand Down
14 changes: 7 additions & 7 deletions lib/repositories/ccextractor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CCExtractor {
SettingsRepository settingsRepository = SettingsRepository();
SettingsModel settings = SettingsModel();
String get ccextractor {
return Platform.isWindows ? './ccextractorwinfull.exe' : 'ccextractor';
return Platform.isWindows ? './ccextractorwinfull.exe' : './ccextractor';
}

Future<int> extractFile(
Expand All @@ -33,7 +33,7 @@ class CCExtractor {
ccextractor,
[
file.path,
'--gui_mode_reports',
'--gui-mode-reports',
...paramsList,
],
);
Expand Down Expand Up @@ -85,11 +85,11 @@ class CCExtractor {
process = await Process.start(
ccextractor,
[
'-' + type,
'--' + type,
location,
tcppasswrd.isNotEmpty ? '-tcppasswrd' + tcppasswrd : '',
tcpdesc.isNotEmpty ? '-tcpdesc' + tcpdesc : '',
'--gui_mode_reports',
tcppasswrd.isNotEmpty ? '--tcp-password ' + tcppasswrd : '',
tcpdesc.isNotEmpty ? '--tcp-description ' + tcpdesc : '',
'--gui-mode-reports',
...paramsList,
],
);
Expand Down Expand Up @@ -141,7 +141,7 @@ class CCExtractor {
ccextractor,
[
...files.map((e) => e.path).toList(),
'--gui_mode_reports',
'--gui-mode-reports',
...paramsList,
],
);
Expand Down
8 changes: 3 additions & 5 deletions lib/repositories/settings_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class SettingsRepository {

settings.enabledtextfields.forEach((param) {
if (!{'encoder', 'rollUp', 'out', 'inp'}.contains(param.keys.first)) {
// no --encoder direct -latin1 or -utf8
// -out=format // no space
// no --encoder direct --latin1 or --utf8
// --out=format // no space
paramsList.add(SettingsModel.paramsLookUpMap[param.keys.first]!);
}
if (param.keys.first == 'outputfilename' && filePath.isNotEmpty) {
paramsList.add(
'${filePath.substring(0, filePath.lastIndexOf(RegExp(r'(\\|\/)')))}/${param.values.first}');
} else if ({'encoder', 'rollUp'}.contains(param.keys.first)) {
paramsList.add('-' + param.values.first);
paramsList.add('--' + param.values.first);
} else if (param.keys.first == 'out' || param.keys.first == 'inp') {
paramsList.add(SettingsModel.paramsLookUpMap[param.keys.first]! +
param.values.first);
Expand All @@ -87,8 +87,6 @@ class SettingsRepository {
paramsList.add(param.values.first);
}
});
// print(paramsList);
// [--append, -autoprogram, -out=webvtt, -utf8]
return paramsList;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/screens/settings/components/current_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CurrentCommandContainer extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: SelectableText(
'ccextractor --gui_mode_reports ${paramsList.reduce((value, element) => value + ' ' + element)} +[input files]',
'ccextractor --gui-mode-reports ${paramsList.reduce((value, element) => value + ' ' + element)} +[input files]',
// maxLines: 2,
style: TextStyle(
fontSize: 15,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/settings/input_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class InputSettingsScreen extends StatelessWidget {
CustomSwitchListTile(
title: 'No auto time ref',
subtitle:
'Some streams come with broadcast date information. When such data is available, CCExtractor will set its time reference to the received data. Use this parameter if prefer your own reference. Note: Current this only affects Teletext in timed transcript with -datets.',
'Some streams come with broadcast date information. When such data is available, CCExtractor will set its time reference to the received data. Use this parameter if prefer your own reference. Note: Current this only affects Teletext in timed transcript with --datets.',
value: state.settingsModel.noautotimeref,
onTap: (value) {
context.read<SettingsBloc>().add(
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/settings/output_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class OutputSettingsScreen extends StatelessWidget {
CustomSwitchListTile(
title: 'Autodash',
subtitle:
'Based on position on screen, attempt to determine the different speakers and a dash (-) when each of them talks (.srt/.vtt only, -trim required).',
'Based on position on screen, attempt to determine the different speakers and a dash (-) when each of them talks (.srt/.vtt only, --trim required).',
value: state.settingsModel.autodash,
onTap: (value) {
context.read<SettingsBloc>().add(
Expand Down
2 changes: 1 addition & 1 deletion test/bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {
expect(
_settingsRepository
.getParamsList(settingsModel)
.contains('-autoprogram'),
.contains('--autoprogram'),
false);
expect(
_settingsRepository
Expand Down