/[svn]/linuxsampler/trunk/src/engines/common/DiskThreadBase.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/DiskThreadBase.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2012 by iliev, Fri Oct 23 17:53:17 2009 UTC revision 2506 by schoenebeck, Sun Jan 12 11:27:05 2014 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2009 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *
7   *   Copyright (C) 2009 Grigor Iliev                                       *   *   Copyright (C) 2009 - 2012 Christian Schoenebeck and Grigor Iliev      *
8     *   Copyright (C) 2013 - 2014 Christian Schoenebeck and Andreas Persson   *
9   *                                                                         *   *                                                                         *
10   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
11   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 67  namespace LinuxSampler { Line 68  namespace LinuxSampler {
68                  bool              bNotify;                  bool              bNotify;
69              };              };
70              struct program_change_command_t {              struct program_change_command_t {
71                  uint8_t Program;                  uint32_t Program;
72                  EngineChannel* pEngineChannel;                  EngineChannel* pEngineChannel;
73              };              };
74              // Attributes              // Attributes
# Line 196  namespace LinuxSampler { Line 197  namespace LinuxSampler {
197                  Thread(true, false, 1, -2),                  Thread(true, false, 1, -2),
198                  pInstruments(pInstruments),                  pInstruments(pInstruments),
199                  DeletionNotificationQueue(4*MaxStreams),                  DeletionNotificationQueue(4*MaxStreams),
200                  ProgramChangeQueue(100)                  ProgramChangeQueue(512)
201              {              {
202                  CreationQueue       = new RingBuffer<create_command_t,false>(4*MaxStreams);                  CreationQueue       = new RingBuffer<create_command_t,false>(4*MaxStreams);
203                  DeletionQueue       = new RingBuffer<delete_command_t,false>(4*MaxStreams);                  DeletionQueue       = new RingBuffer<delete_command_t,false>(4*MaxStreams);
# Line 382  namespace LinuxSampler { Line 383  namespace LinuxSampler {
383               * Tell the disk thread to do a program change on the specified               * Tell the disk thread to do a program change on the specified
384               * EngineChannel.               * EngineChannel.
385               */               */
386              int OrderProgramChange(uint8_t Program, EngineChannel* pEngineChannel) {              int OrderProgramChange(uint32_t Program, EngineChannel* pEngineChannel) {
387                  program_change_command_t cmd;                  program_change_command_t cmd;
388                  cmd.Program = Program;                  cmd.Program = Program;
389                  cmd.pEngineChannel = pEngineChannel;                  cmd.pEngineChannel = pEngineChannel;
# Line 503  namespace LinuxSampler { Line 504  namespace LinuxSampler {
504                      }                      }
505    
506                      // perform MIDI program change commands                      // perform MIDI program change commands
507                      while (ProgramChangeQueue.read_space() > 0) {                      if (ProgramChangeQueue.read_space() > 0) {
508                          program_change_command_t cmd;                          program_change_command_t cmd;
509                          ProgramChangeQueue.pop(&cmd);                          // skip all old ones, only process the latest one
510                            do {
511                                ProgramChangeQueue.pop(&cmd);
512                            } while (ProgramChangeQueue.read_space() > 0);
513                          cmd.pEngineChannel->ExecuteProgramChange(cmd.Program);                          cmd.pEngineChannel->ExecuteProgramChange(cmd.Program);
514                      }                      }
515    
516                      RefillStreams(); // refill the most empty streams                      RefillStreams(); // refill the most empty streams
517    
518                      // if nothing was done during this iteration (eg no streambuffer                      // if nothing was done during this iteration (eg no streambuffer

Legend:
Removed from v.2012  
changed lines
  Added in v.2506

  ViewVC Help
Powered by ViewVC