Audio-Nama

 view release on metacpan or  search on metacpan

lib/Audio/Nama.pm  view on Meta::CPAN

use Audio::Nama::Graph ();
use Audio::Nama::Modes ();
use Audio::Nama::Mix ();
use Audio::Nama::Memoize ();

use Audio::Nama::StatusSnapshot ();
use Audio::Nama::EngineSetup ();
use Audio::Nama::EffectsRegistry ();
use Audio::Nama::Effect q(:all);
use Audio::Nama::MuteSoloFade ();
use Audio::Nama::Jack ();

use Audio::Nama::Regions ();
use Audio::Nama::CacheTrack ();
use Audio::Nama::Bunch ();
use Audio::Nama::Wavinfo ();
use Audio::Nama::Midi ();
use Audio::Nama::Latency ();
use Audio::Nama::Log qw(logit logpkg logsub initialize_logger);
use Audio::Nama::TrackUtils ();

use Audio::Nama::Tempo ();

sub main { 
	say eval join(get_data_section('banner'), qw(" "));
	bootstrap_environment() ;
	load_project(name => shift @ARGV,
				 create => delete $config->{opts}->{c}); 
				 		 # remove option for next project load
	nama_cmd($config->{execute_on_project_load});
	nama_cmd($config->{opts}->{X});
	reconfigure_engine();
	if (not $ti{3}){ # no user tracks
		say "Enter command to begin or type 'h' for help.";
		$this_track = $tn{Main};
	}
	show_prompt();
	$ui->loop();
}

sub bootstrap_environment {
	definitions();
	process_command_line_options();
	start_logging();
	setup_grammar();
	initialize_interfaces();
    redirect_stdout() unless  $config->{opts}->{T};
}
sub kill_and_reap {
	my @pids = @_;
	map{ my $pid = $_; 
		 map{ my $signal = $_; 
			  kill $signal, $pid; 
			  sleeper(0.2);
			} (15,9);
		 waitpid $pid, 1;
	} @pids;
}
	
sub cleanup_exit {
	logsub((caller(0))[3]);
 	remove_riff_header_stubs();
	trigger_rec_cleanup_hooks();
	# for each process: 
	# - SIGINT (1st time)
	# - allow time to close down
	# - SIGINT (2nd time)
	# - allow time to close down
	# - SIGKILL
	#project_snapshot(); 
	Audio::Nama::Engine::sync_action('kill_and_reap');
	$text->{term}->teardown;
	restore_stdout();
	say;
	exit;
}
END { }

1;
__DATA__
@@ commands_yml
---
help:
  type: help 
  what: Display help on Nama commands.
  short: h
  parameters: [ <integer:help_topic_index> | <string:help_topic_name> | <string:command_name> ]
  example: |
    help marks # display the help category marks and all commands containing marks
    help 6 # display help on the effects category
    help mfx # display help on modify-effect - shortcut mfx
help_effect:
  type: help
  what: Display detailed help on LADSPA or LV2 effects.
  short: hfx he
  parameters: <string:label> | <integer:unique_id>
  example: |
    help-effect 1970 
    ! display help on Fons Adriaensen's parametric EQ (LADSPA)
    help-effect etd 
    ! prints a short message to consult Ecasound manpage, 
    ! where the etd chain operator is documented.
    hfx lv2-vocProc 
    ! display detailed help on the LV2 VocProc effect
find_effect:
  type: help
  what: Display one-line help for effects matching the search string(s).
  short: ffx fe
  parameters: <string:keyword1> [ <string:keyword2>... ]
  example: |
    find-effect compressor 
    ! List all effects containing "compressor" in their name or parameters
    fe feedback 
    ! List all effects matching "feedback" 
    ! (for example a delay with a feedback parameter)
exit:
  type: general
  what: Exit Nama, saving settings (the current project).
  short: quit q
  parameters: none
memoize:



( run in 2.162 seconds using v1.01-cache-2.11-cpan-0b58ddf2af1 )