|
|
@ -310,7 +310,8 @@ int perframe_direct(struct ncvisual* ncv, struct ncvisual_options* vopts,
|
|
|
|
|
|
|
|
|
|
|
|
// argc/argv ought already be reduced to only the media arguments
|
|
|
|
// argc/argv ought already be reduced to only the media arguments
|
|
|
|
int direct_mode_player(int argc, char** argv, ncscale_e scalemode,
|
|
|
|
int direct_mode_player(int argc, char** argv, ncscale_e scalemode,
|
|
|
|
ncblitter_e blitter, int lmargin){
|
|
|
|
ncblitter_e blitter, int lmargin,
|
|
|
|
|
|
|
|
unsigned transcolor){
|
|
|
|
Direct dm{};
|
|
|
|
Direct dm{};
|
|
|
|
if(!dm.canopen_images()){
|
|
|
|
if(!dm.canopen_images()){
|
|
|
|
std::cerr << "Notcurses was compiled without multimedia support\n";
|
|
|
|
std::cerr << "Notcurses was compiled without multimedia support\n";
|
|
|
@ -340,6 +341,10 @@ int direct_mode_player(int argc, char** argv, ncscale_e scalemode,
|
|
|
|
vopts.scaling = scalemode;
|
|
|
|
vopts.scaling = scalemode;
|
|
|
|
vopts.x = static_cast<int>(a);
|
|
|
|
vopts.x = static_cast<int>(a);
|
|
|
|
vopts.flags = NCVISUAL_OPTION_HORALIGNED;
|
|
|
|
vopts.flags = NCVISUAL_OPTION_HORALIGNED;
|
|
|
|
|
|
|
|
if(transcolor){
|
|
|
|
|
|
|
|
vopts.flags |= NCVISUAL_OPTION_ADDALPHA;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
vopts.transcolor = transcolor & 0xffffffull;
|
|
|
|
if(dm.streamfile(argv[i], perframe_direct, &vopts, NULL)){
|
|
|
|
if(dm.streamfile(argv[i], perframe_direct, &vopts, NULL)){
|
|
|
|
failed = true;
|
|
|
|
failed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -504,7 +509,8 @@ auto main(int argc, char** argv) -> int {
|
|
|
|
// if -k was provided, we now use direct mode rather than simply not using the
|
|
|
|
// if -k was provided, we now use direct mode rather than simply not using the
|
|
|
|
// alternate screen, so that output is inline with the shell.
|
|
|
|
// alternate screen, so that output is inline with the shell.
|
|
|
|
if(ncopts.flags & NCOPTION_NO_ALTERNATE_SCREEN){
|
|
|
|
if(ncopts.flags & NCOPTION_NO_ALTERNATE_SCREEN){
|
|
|
|
r = direct_mode_player(argc - nonopt, argv + nonopt, scalemode, blitter, ncopts.margin_l);
|
|
|
|
r = direct_mode_player(argc - nonopt, argv + nonopt, scalemode, blitter,
|
|
|
|
|
|
|
|
ncopts.margin_l, transcolor);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
r = rendered_mode_player(argc - nonopt, argv + nonopt, scalemode, blitter, ncopts,
|
|
|
|
r = rendered_mode_player(argc - nonopt, argv + nonopt, scalemode, blitter, ncopts,
|
|
|
|
quiet, loop, timescale, displaytime, transcolor);
|
|
|
|
quiet, loop, timescale, displaytime, transcolor);
|
|
|
|