/[svn]/libgig/trunk/src/gig.cpp
ViewVC logotype

Diff of /libgig/trunk/src/gig.cpp

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

revision 3955 by schoenebeck, Sat Jun 19 10:38:45 2021 UTC revision 3970 by schoenebeck, Thu Jun 24 11:49:31 2021 UTC
# Line 5308  namespace { Line 5308  namespace {
5308       * @param pos - position of sought Region in region list       * @param pos - position of sought Region in region list
5309       * @returns pointer address to requested region or @c NULL if @a pos is       * @returns pointer address to requested region or @c NULL if @a pos is
5310       *          out of bounds       *          out of bounds
5311         * @see CountRegions()
5312       */       */
5313      Region* Instrument::GetRegionAt(size_t pos) {      Region* Instrument::GetRegionAt(size_t pos) {
5314          if (!pRegions) return NULL;          if (!pRegions) return NULL;
# Line 5676  namespace { Line 5677  namespace {
5677       * @param index - index of the script slot on this instrument       * @param index - index of the script slot on this instrument
5678       * @see Script::Bypass       * @see Script::Bypass
5679       */       */
5680      bool Instrument::IsScriptSlotBypassed(uint index) {      bool Instrument::IsScriptSlotBypassed(size_t index) {
5681          if (index >= ScriptSlotCount()) return false;          if (index >= ScriptSlotCount()) return false;
5682          return pScriptRefs ? pScriptRefs->at(index).bypass          return pScriptRefs ? pScriptRefs->at(index).bypass
5683                             : scriptPoolFileOffsets.at(index).bypass;                             : scriptPoolFileOffsets.at(index).bypass;
# Line 5696  namespace { Line 5697  namespace {
5697       * @param bBypass - if true, the script slot will be skipped by the sampler       * @param bBypass - if true, the script slot will be skipped by the sampler
5698       * @see Script::Bypass       * @see Script::Bypass
5699       */       */
5700      void Instrument::SetScriptSlotBypassed(uint index, bool bBypass) {      void Instrument::SetScriptSlotBypassed(size_t index, bool bBypass) {
5701          if (index >= ScriptSlotCount()) return;          if (index >= ScriptSlotCount()) return;
5702          if (pScriptRefs)          if (pScriptRefs)
5703              pScriptRefs->at(index).bypass = bBypass;              pScriptRefs->at(index).bypass = bBypass;
# Line 5742  namespace { Line 5743  namespace {
5743       * @param slot - script slot index of the variable to be retrieved       * @param slot - script slot index of the variable to be retrieved
5744       * @param variable - name of the 'patch' variable in that script       * @param variable - name of the 'patch' variable in that script
5745       */       */
5746      bool Instrument::IsScriptPatchVariableSet(int slot, String variable) {      bool Instrument::IsScriptPatchVariableSet(size_t slot, String variable) {
5747          if (variable.empty()) return false;          if (variable.empty()) return false;
5748          Script* script = GetScriptOfSlot(slot);          Script* script = GetScriptOfSlot(slot);
5749          if (!script) return false;          if (!script) return false;
# Line 5776  namespace { Line 5777  namespace {
5777       *       *
5778       * @param slot - script slot index of the variable to be retrieved       * @param slot - script slot index of the variable to be retrieved
5779       */       */
5780      std::map<String,String> Instrument::GetScriptPatchVariables(int slot) {      std::map<String,String> Instrument::GetScriptPatchVariables(size_t slot) {
5781          Script* script = GetScriptOfSlot(slot);          Script* script = GetScriptOfSlot(slot);
5782          if (!script) return std::map<String,String>();          if (!script) return std::map<String,String>();
5783          const _UUID uuid = _UUIDFromCArray(&script->Uuid[0]);          const _UUID uuid = _UUIDFromCArray(&script->Uuid[0]);
# Line 5808  namespace { Line 5809  namespace {
5809       * @param slot - script slot index of the variable to be retrieved       * @param slot - script slot index of the variable to be retrieved
5810       * @param variable - name of the 'patch' variable in that script       * @param variable - name of the 'patch' variable in that script
5811       */       */
5812      String Instrument::GetScriptPatchVariable(int slot, String variable) {      String Instrument::GetScriptPatchVariable(size_t slot, String variable) {
5813          std::map<String,String> vars = GetScriptPatchVariables(slot);          std::map<String,String> vars = GetScriptPatchVariables(slot);
5814          return (vars.count(variable)) ? vars.find(variable)->second : "";          return (vars.count(variable)) ? vars.find(variable)->second : "";
5815      }      }
# Line 5835  namespace { Line 5836  namespace {
5836       * @throws gig::Exception if given script @p slot index is invalid or given       * @throws gig::Exception if given script @p slot index is invalid or given
5837       *         @p variable name is empty       *         @p variable name is empty
5838       */       */
5839      void Instrument::SetScriptPatchVariable(int slot, String variable, String value) {      void Instrument::SetScriptPatchVariable(size_t slot, String variable, String value) {
5840          if (variable.empty())          if (variable.empty())
5841              throw Exception("Variable name must not be empty");              throw Exception("Variable name must not be empty");
5842          Script* script = GetScriptOfSlot(slot);          Script* script = GetScriptOfSlot(slot);
# Line 5876  namespace { Line 5877  namespace {
5877       * @param slot - script slot index of the variable to be unset       * @param slot - script slot index of the variable to be unset
5878       * @param variable - name of the 'patch' variable in that script       * @param variable - name of the 'patch' variable in that script
5879       */       */
5880      void Instrument::UnsetScriptPatchVariable(int slot, String variable) {      void Instrument::UnsetScriptPatchVariable(ssize_t slot, String variable) {
5881          Script* script = GetScriptOfSlot(slot);          Script* script = GetScriptOfSlot(slot);
5882    
5883          // option 1: unset a particular variable of one particular script slot          // option 1: unset a particular variable of one particular script slot
# Line 6513  namespace { Line 6514  namespace {
6514              ExtensionFiles.push_back(pExtFile);              ExtensionFiles.push_back(pExtFile);
6515          }          }
6516    
6517          // load samples from extension files (if required)          // load all samples (both from this/main .gig file as well as from
6518            // extension files if required)
6519          for (int i = 0; i < poolFiles.size(); i++) {          for (int i = 0; i < poolFiles.size(); i++) {
6520              RIFF::File* file = poolFiles[i];              RIFF::File* file = poolFiles[i];
6521              RIFF::List* wvpl = file->GetSubList(LIST_TYPE_WVPL);              RIFF::List* wvpl = file->GetSubList(LIST_TYPE_WVPL);
6522              if (wvpl) {              if (wvpl) {
6523                  file_offset_t wvplFileOffset = wvpl->GetFilePos() -                  file_offset_t wvplFileOffset = wvpl->GetFilePos() -
6524                                                 wvpl->GetPos(); // should be zero, but just to be sure                                                 wvpl->GetPos(); // should be zero, but just to be sure
6525                  size_t i = 0;                  size_t iWaveCk = 0;
6526                  for (RIFF::List* wave = wvpl->GetSubListAt(i); wave;                  for (RIFF::List* wave = wvpl->GetSubListAt(iWaveCk); wave;
6527                       wave = wvpl->GetSubListAt(++i))                       wave = wvpl->GetSubListAt(++iWaveCk))
6528                  {                  {
6529                      if (wave->GetListType() == LIST_TYPE_WAVE) {                      if (wave->GetListType() == LIST_TYPE_WAVE) {
6530                          // notify current progress                          // notify current progress

Legend:
Removed from v.3955  
changed lines
  Added in v.3970

  ViewVC Help
Powered by ViewVC