Audio-Nama
view release on metacpan or search on metacpan
lib/Audio/Nama/Initializations.pm view on Meta::CPAN
qw(-t), # set text mode
qw(-d), $Audio::Nama::test_dir,
q(-E), # suppress loading Ecasound
q(-J), # fake jack client data
q(-T), # don't initialize terminal
# load fake effects cache
# q(-c), 'test-project',
#qw(-L SUB); # logging
$jack->{periodsize} = 1024;
}
sub apply_ecasound_test_args {
apply_test_args();
@ARGV = grep { $_ ne q(-E) } @ARGV
}
sub definitions {
STDOUT->autoflush;
@global_effect_chain_vars = qw(
@global_effect_chain_data
$Audio::Nama::EffectChain::n
$fx->{alias}
);
@tracked_vars = qw(
@tracks_data
@bus_data
@groups_data
@marks_data
@fade_data
@edit_data
@inserts_data
@effects_data
$fx->{applied}
$fx->{params}
$fx->{params_log}
);
@persistent_vars = qw(
$project->{nama_version}
$project->{nama_commit}
$project->{timebase}
$project->{command_buffer}
$project->{track_version_comments}
$project->{track_comments}
$project->{bunch}
$project->{current_op}
$project->{current_param}
$project->{current_stepsize}
$project->{playback_position}
$project->{sample_rate}
$project->{waveform}
@project_effect_chain_data
$fx->{id_counter}
$setup->{loop_endpoints}
$mode->{loop_enable}
$mode->{mastering}
$mode->{preview}
$mode->{midi_transport_sync}
$gui->{_seek_unit}
$text->{command_history}
$text->{command_index}
$this_track_name
$this_op
);
$text->{wrap} = Text::Format->new( {
columns => 75,
firstIndent => 0,
bodyIndent => 0,
tabstop => 4,
});
####### Initialize singletons #######
# Some of these "singletons" (imported by 'use Globals')
# are just hashes, some have object behavior as
# the sole instance of their class.
$project = bless {}, 'Audio::Nama::Project';
our $mode = bless {}, 'Audio::Nama::Mode';
{ package Audio::Nama::Mode;
sub mastering { $Audio::Nama::tn{Eq} and ! $Audio::Nama::tn{Eq}->{hide} }
sub eager { $mode->{eager} }
sub doodle { $mode->{doodle} }
sub preview { $mode->{preview} }
sub song { $mode->eager and $mode->preview }
sub live { $mode->eager and $mode->doodle }
}
# for example, $file belongs to class Audio::Nama::File, and uses
# AUTOLOAD to generate methods to provide full path
# to various system files, such as $file->state_store
{
package Audio::Nama::File;
use Carp;
sub logfile {
my $self = shift;
$ENV{NAMA_LOGFILE} || $self->_logfile
}
sub AUTOLOAD {
my ($self, $filename) = @_;
# get tail of method call
my ($method) = $Audio::Nama::File::AUTOLOAD =~ /([^:]+)$/;
croak "$method: illegal method call" unless $self->{$method};
my $dir_sub = $self->{$method}->[1];
$filename ||= $self->{$method}->[0];
my $path = Audio::Nama::join_path($dir_sub->(), $filename);
$path;
}
sub DESTROY {}
1;
}
$file = bless
{
( run in 2.299 seconds using v1.01-cache-2.11-cpan-5735350b133 )