My plug-in works before saving the *.izz file but not after



  • Hi,

    I have a plug-in on Isadora that I wrote and that have this strange behaviour:
    When I open a new Isadora instance and I add the actor I wrote and the audio file on Media Windows that my actor is supposed to play, the actor works fine.
    But when I save this file, close Isadora then open Isadora again and open the file then the actor does not work anymore. (It is supposed to play an audio file to given channels on a multichannel device, but it just does nothing when it is used from a saved *.izz file), and if I try then to close Isadora, my Windows OS will complain about Isadora not working anymore.

    I have another plug-in that essentially do the thing the first plug-in do four times (it accepts up to 4 audio files that it will send to given channels on an 8 channel output audio device). Same as the first one, if I call it from an untitled file in a new instance of Isadora, the actor works fine. But, if I save a file whith just one actor and one audio file on the media window and then close Isadora, open it again and open the file again, I get an error message like this:

    "This document contains inconsistent links beetween actors. The offending links have been removed.
    Inconsistent links can occur because of errors in the way that actors are programmed by their author. When this happens, Isadora removes the inconsistent links. You should check all of your scenes to determine the which links are deleted."

    and my actor do not work anymore. I don't understand this message because the plug-in I wrote do not uses another actors and on the file there is only one actor so I don't understand about what links is this error message talking about.

    I will be grateful for any suggestions on how to improve my actor.


  • Tech Staff



  • Dear JolkaP,

    Please send me the user actor at mark [atta] troikatronix [dotta] com -- I'll have a look. Please let me know the version of Isadora you are using, and your operating system and operating system version as well.
    Best Wishes,
    Mark


  • Dear Mark,

    I am sending it right now, thanks for your interest.

    My operating system is Windows 7.
    My version of Isadora is 1.3.0f24

    Bye



  • Hello everybody,

    Trying to figure out where the problem appears, I started again the construction of the actor by "step by step" modifications starting from the Sample Plugin delivered with Isadora SDK and verifying each time if I have problems after saving the file.

    I think I found the moment where the message about inconsistent links appears. As I explained before, I was working on two kinds of actors, one that takes three entries: sound index, and two channel numbers, and plays the given sound two given channels; and another actor that does the same thing four times (see joint images). Now that I was adding modifications "step by step", I have this strange situation with two actors that do essentially nothing yet, one of them have three entries, the other twelve, and only the second one have the message I talked about when saved and recovered "This document contains inconsistent links beetween actors[...]"

    @Mark: This means that there is a maximal numbers of entries? How much is the maximum? I send you more code by mail because the forum does not allow upload of *.cpp files

    Goodbye
    1aef63-3entries.png 6a823c-12entries.png



  • Oh,
    I figured out why the message about "inconsistent links" appeared with the version of the actor with 12 entries. I made a mistake when defining the new property definition string on the larger actor, and there where repeated IDs in the property definition string.

    Correcting this error makes that the message about "inconsistent links" does not appear anymore. But still I have a plug-in that works before saving but not after.



  • Hello everybody,

    I found what is that makes the actor different before and after saving the file. In order to find the path to the file I will play to different channels, I use the following macro from the Isadora SDK
    GetUTF8PathToCurrentDocument_()
    (I think it is declared in the IsadoraCallbacks header)
    Well, it is supposed to work differently if the file is saved or not, because in the first case it gives empty path, and in the second case it gives the path where the document was saved. So, the file I want to play has to be saved at the same folder as the Isadora document that will use it.
    But even if both files are in the same folder, my actor doesn't work. I found that when I try to play a sound file from an already saved file with my actor inside, a control variable called isDeviceRecognized (that is inside my PluginInfo structure) changes to false just after using this macro. IMHO this is an unexpected behaviour, so I will send a bug report tomorrow (not now because I do not have all the code right now with me).
    Bye,



  • As I explained yesterday, I found an unexpected behaviour little time after calling  
    GetUTF8PathToCurrentDocument_(izzyParamsPtr, inThingPtr, inMaxLen, outString)  
    from my actor. I thought it was because of this function, but in fact I am quite sure now it is not.

    I call the function GetUTF8PathToCurrentDocument_ only from the HAndlePropertyChangeValue, when  
    the number of the audio file to be played change.  
    switch (inPropertyIndex1) {
    case kInputSoundNum1:{
    info->mSoundIndex[0] = (int)(inNewValue->u.ivalue);
    if(info->mSoundIndex[0]>0){[...]
        info->fileName[0][255]='\0';
        ExecuteMediaCommand_(ip, inActorInfo, 0, kMediaGetName, kMediaTypeAudio, info->mSoundIndex[0], (long) info->fileName[0],sizeof(info->fileName[0]));
        char fpBuf[1024];
        Boolean success = GetUTF8PathToCurrentDocument_(ip, inActorInfo->mThing, sizeof(fpBuf), fpBuf);
        if (success==TRUE && IsRelativePathName(info->fileName[1])) {
            strncat(fpBuf, info->fileName[1], sizeof(fpBuf));
            strncpy(info->fileName[1],fpBuf, sizeof(fpBuf));
        }
        [...]
    }[...]
    }
    break; [...]}

    I am using Visual Studio 2008 on Windows 7, latest IsadoraSDK available on the troikatronix.com site and Isadora 1.3.0f24. In the code above, when I debug it with a VisualStudio debugger, I have three cases

    • when I put some file to play in a non saved Isadora document, the path I get from GetUTF8PathToCurrentDocument_ is some string that looks like an empty string and I can play the file.
    • when I save the file, the path I get is the absolute path to the place where I saved the Isadora file. So the file is correcly recognized, but strangely just after the code I copy-pasted above, I see that a private member of my actor called "isDeviceRecognized" and of type bool change from true value to false value. I don't know if this is the only variable that changes, neither I know why it changes. I use it as a condition to play sound inside my ReceiveMessage function, so in this case this unexpected change explains why no sound is played when calling my actor from a saved file.
    • when I open an already saved file from the instance of ISadora opened by the  debugger, I have the same behaviour as in the case above (the case where I save the file from the instance of Isadora opened by the debugger)

    If I debug with the five last lines of the code above commented, the unexpected change of the isDeviceRecognized does not happen. If I debug commenting only the isRelativePathName condition, the unexpected change of isDeviceRecognized still happen.

    I tried also to manually reassign the true value to isDeviceRecognized, and if I do so, I can play up to one file at once from the debugger, but from the second file on it does not work anymore. I guess this is because isDeviceRecognized is not the only private variable that has unexpected changes.

    Please, somebody can help me understand why after a call inside the "if instruction" to strncat and strncopy as in the code above, private members of my actor changes?  And why this happens only inside already saved files?



  • Hello everybody,
    My problem is solved,
    We just found the origin of the error: it is something in strncat or strncopy function that was changing private members of the variable, maybe because the size passed to this functions was not right or maybe just because they are not sure functions. We changed to an sprintf function for whom it is not necessary to specify the length of the strings. Maybe because the size of fpBuf where I was keeping the path was small when the Isadora file was not saved yet, we did not see the problem until the *.izz file was saved.
    Goodbye


  • Tech Staff

    Will something about this problem be noted in the SDK?



  • Noted about ??? From what he said, I think it was a bug in their code, no?

    -- M

Log in to reply
 

Looks like your connection to TroikaTronix Community Forum was lost, please wait while we try to reconnect.