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 - 2009 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 Grigor Iliev * |
* Copyright (C) 2009 - 2011 Grigor Iliev * |
8 |
* * |
* * |
9 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
10 |
* 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 * |
110 |
|
|
111 |
::sfz::Instrument* InstrumentResourceManager::Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg) { |
::sfz::Instrument* InstrumentResourceManager::Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg) { |
112 |
// get sfz file from internal sfz file manager |
// get sfz file from internal sfz file manager |
113 |
::sfz::File* pSfz = Sfzs.Borrow(Key.FileName, (SfzConsumer*) Key.Index); // conversion kinda hackish :/ |
::sfz::File* pSfz = Sfzs.Borrow(Key.FileName, reinterpret_cast<SfzConsumer*>(Key.Index)); // conversion kinda hackish :/ |
114 |
|
|
115 |
dmsg(1,("Loading sfz instrument ('%s',%d)...",Key.FileName.c_str(),Key.Index)); |
dmsg(1,("Loading sfz instrument ('%s',%d)...",Key.FileName.c_str(),Key.Index)); |
116 |
if (Key.Index) { |
if (Key.Index) { |
159 |
void InstrumentResourceManager::Destroy( ::sfz::Instrument* pResource, void* pArg) { |
void InstrumentResourceManager::Destroy( ::sfz::Instrument* pResource, void* pArg) { |
160 |
instr_entry_t* pEntry = (instr_entry_t*) pArg; |
instr_entry_t* pEntry = (instr_entry_t*) pArg; |
161 |
// we don't need the .sfz file here anymore |
// we don't need the .sfz file here anymore |
162 |
Sfzs.HandBack(pEntry->pSfz, (SfzConsumer*) pEntry->ID.Index); // conversion kinda hackish :/ |
Sfzs.HandBack(pEntry->pSfz, reinterpret_cast<SfzConsumer*>(pEntry->ID.Index)); // conversion kinda hackish :/ |
163 |
delete pEntry; |
delete pEntry; |
164 |
} |
} |
165 |
|
|