[Cin] Use MAXCHANNELS define in mwindow.C

Andrew Randrianasulu randrianasulu at gmail.com
Thu Nov 19 03:07:15 CET 2020


Rest of CinGG seems to use it:

guest at slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep 'MAXCHANNELS' *.C
arender.C:      for( int i=0; i<MAXCHANNELS; ++i ) {
arender.C:      for( int i=0; i<MAXCHANNELS; ++i ) delete buffer[i];
arender.C:      meter_history->init(MAXCHANNELS, calculate_history_size());
arender.C:      for( int i=0; i<MAXCHANNELS; ++i ) {
arender.C:      for( int i=0; i<MAXCHANNELS; ++i ) {
arender.C:              for(int i = 0; i < MAXCHANNELS; i++)
arender.C:      for(int i = 0; i < MAXCHANNELS; i++)
assetedit.C:            (int)MAXCHANNELS, x, y, xS(50))
audioconfig.C:  CLAMP(oss_in_channels, 1, MAXCHANNELS);
audioconfig.C:  CLAMP(oss_duplex_channels, 1, MAXCHANNELS);
convert.C:              for( int i=0; i < MAXCHANNELS; ++i ) pan_auto->values[i] = 0;
convert.C:              if( atrack >= MAXCHANNELS ) atrack = 0;
dcoffset.C:     for(int i = 0; i < MAXCHANNELS; i++) dc_offset[i] = 0;
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++)
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++) {
edlsession.C:   for( int i=0; i<MAXCHANNELS; ++i ) {
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++) {
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++)
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++) {
edlsession.C:   Workarounds::clamp(audio_channels, 0, MAXCHANNELS - 1);
edlsession.C:   Workarounds::clamp(video_channels, 1, MAXCHANNELS - 1);
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++)
edlsession.C:   for(int i = 0; i < MAXCHANNELS; i++) {
fileformat.C: : BC_TumbleTextBox(fwindow, (int)atol(text), (int)1, (int)MAXCHANNELS, x, y, 50)
mwindowedit.C:                  for( int i=0; i < MAXCHANNELS; ++i ) {
panauto.C:      bzero(values, MAXCHANNELS * sizeof(float));
panauto.C:      bzero(values, MAXCHANNELS * sizeof(float));
panauto.C:      memcpy(this->values, pan_auto->values, MAXCHANNELS * sizeof(float));
preferences.C:  while( channels < MAXCHANNELS ) {
preferences.C:  for( int i=0; i<MAXCHANNELS; ++i ) {
preferences.C:  for( int i = 0; i < MAXCHANNELS; i++ ) {
record.C:       for( int i=0; i<MAXCHANNELS; ++i ) {
record.C:       for( int i=0; i<MAXCHANNELS; ++i ) {
recordgui.C:    for( int i=0; i<MAXCHANNELS; ++i ) {
renderengine.C:         for( int i=0; i<MAXCHANNELS; ++i ) {
resourcethread.C:       for(int i = 0; i < MAXCHANNELS; i++)
resourcethread.C:       for(int i = 0; i < MAXCHANNELS; i++)
resourcethread.C:                                               for( int i=0; i<MAXCHANNELS; ++i ) {
setformat.C:    CLAMP(new_channels, 1, MAXCHANNELS);
setformat.C:    add_subwindow(new BC_ITumbler(channels, 0, MAXCHANNELS,
setformat.C:    int new_channels = CLIP(atoi(get_text()), 0, MAXCHANNELS);
tracking.C:     double output_levels[MAXCHANNELS];
virtualanode.C: for(int i = 0; i < MAXCHANNELS; i++)
vtracking.C:    double output_levels[MAXCHANNELS];
vwindowgui.C:   Samples *samples[MAXCHANNELS];
vwindowgui.C:   while( ch < MAXCHANNELS ) samples[ch++] = 0;
guest at slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep 'MAXCHANNELS' *.h
arender.h:      Samples *audio_out[MAXCHANNELS];
arender.h:      Samples *buffer[MAXCHANNELS];
arender.h:      int buffer_allocated[MAXCHANNELS];
dcoffset.h:     int dc_offset[MAXCHANNELS], dc_offset_total[MAXCHANNELS], dc_offset_count;
edlsession.h:   int achannel_positions[MAXCHANNELS];
edlsession.h:   int vchannel_x[MAXCHANNELS];
edlsession.h:   int vchannel_y[MAXCHANNELS];
maxchannels.h:#ifndef MAXCHANNELS
maxchannels.h:#define MAXCHANNELS 32
panauto.h:      float values[MAXCHANNELS];
preferences.h:  int channel_positions[MAXCHANNELS][MAXCHANNELS];
record.h:       int64_t dc_offset[MAXCHANNELS];
recordgui.h:    RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS];
recordgui.h:    BC_Meter *meter[MAXCHANNELS];
virtualanode.h: Auto *pan_before[MAXCHANNELS], *pan_after[MAXCHANNELS];


so I used it for max number of channels for auto-created project (was just 6):

diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C
index f245018a..690c7ef8 100644
--- a/cinelerra-5.1/cinelerra/mwindow.C
+++ b/cinelerra-5.1/cinelerra/mwindow.C
@@ -5088,7 +5107,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra
                int channels = 0;
                for( uint64_t mask=channel_mask; mask!=0; mask>>=1 ) channels += mask & 1;
                if( channels < 1 ) channels = 1;
-               if( channels > 6 ) channels = 6;
+               if( channels > MAXCHANNELS ) channels = MAXCHANNELS;
                session->audio_tracks = session->audio_channels = channels;

                int *achannel_positions = preferences->channel_positions[session->audio_channels-1];

=====





More information about the Cin mailing list