Prev Previous Post   Next Post Next
Old 04-12-2012, 04:27 PM   #1
KarlLai
Human being with feelings
 
KarlLai's Avatar
 
Join Date: Feb 2012
Posts: 26
Default About PCM_Source_CreateFromType("MIDI")...

Hi,

I am trying to create multiple takes with multiple midi sources in a track with C++ codes, like this:

Code:
  // add a media item
  MediaItem* newMediaItem = AddMediaItemToTrack(newReaperTrack);
  GetSetMediaItemInfo(newMediaItem, "D_POSITION", &startTime);
  GetSetMediaItemInfo(newMediaItem, "D_LENGTH", &length);

  PCM_source* newSource = PCM_Source_CreateFromType("MIDI");

  // add a take
  MediaItem_Take* newTake = AddTakeToMediaItem(newMediaItem);
  GetSetMediaItemTakeInfo(newTake, "P_NAME", (void*)name);
  GetSetMediaItemTakeInfo(newTake, "P_SOURCE", (void*)newSource);
  GetSetMediaItemTakeInfo(newTake, "D_STARTOFFS", &startTime);
After I compiled the codes and put the plugin in reaper, it did create a new media item. However, there is a weird string of "offline" in the middle of that media item, and I cannot open it with the midi editor.

What does that mean? How do I fix it?

Also, when I search in SWS codes, there is only one place that use PCM_Source_CreateFromType(), and it's commented out. The comment says, "JFB!!! commented: generating evts from scratch does not work, unfortunately.. nailed it down to PCM_Source_CreateFromType("MIDI") which seems to be KO (?)". Does that mean this API function is not even working properly?

Thank you.

Last edited by KarlLai; 04-17-2012 at 02:12 PM.
KarlLai is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.