Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Channel names return blank on FL 12, FL 20.6, and 20.7 files #8

Closed
NostalgiaRunner opened this issue May 26, 2020 · 7 comments
Closed

Comments

@NostalgiaRunner
Copy link

Hello there!

I am having a small issue with the parser and I'm wondering if it's an issue with my driving code, or the library itself.

When I run this:

Project proj = Project.Load("sample.flp", false);
Console.WriteLine("FL Version: "+proj.VersionString);
foreach (Channel chan in proj.Channels){
	Console.WriteLine(chan.Id+" | "+chan.Name+" | "+chan.Color);
}

The output returns as:

FL Version: 20.7.0.1714
0 |  | 16777215
1 |  | 16777215
2 |  | 16777215
3 |  | 8288104

Instead of:
image
With the exact same results occurring on a random FL 12 file.

Please help, and thank you greatly for your time.

@cpdt
Copy link
Member

cpdt commented May 28, 2020

Sorry, it's been a while since I've touched this, but I think you need to go through the Data property since FL uses the generator name when the channel doesn't have an explicit name. Does this do what you're expecting?

string name;
GeneratorData data = chan.Data as GeneratorData;
if (!string.IsNullOrEmpty(chan.Name) || data == null) {
    name = chan.Name;
} else {
    name = data.GeneratorName;
}

If not, please let me know and I'll look more into it!

@NostalgiaRunner
Copy link
Author

Sorry for the late reply. I suppose I should have mentioned ahead of time that I tried that too. It's still not it, but it's got the right idea. Channels 1-3 are now being called "Fruity Wrapper" which I can only assume is internal for VstPlugin, and "Sampler" for Channel 4. I've looked through all of the FLPs I tested, and was able to find all of the strings with a hex editor. I don't think much has changed except maybe it's in a different spot than the program is expecting?

@NostalgiaRunner
Copy link
Author

Are commits still open if I happen to figure out what the issue is?

@cpdt
Copy link
Member

cpdt commented Jun 27, 2020

Hey! Really sorry about the radio silence, life's been busy and I haven't had the chance to look more into this. Were you able to figure it out? If so I'll gladly accept some pointers to fix it in this repo, or even better a PR. Otherwise I'll try to look into it soon!

@NostalgiaRunner
Copy link
Author

I understand. Hope things are going well for you now. I apologize for the late response as I was fuming. Please see #10. I do not wish to derail this conversation though. Now that my head is clear. Having taken apart this repo and ported it completely to Python for debugging purposes. While I have no code to contribute, I do understand what the issue was. Those strings shown in the screenshot would be of enum type TextPluginName. Though I can't remember if the information from those events are accessible from this code. Why these would be plugin names instead of channel names? I'm not sure. I suppose only the format's designer could tell us that. Lol. Hope that clears some things up.

@cpdt
Copy link
Member

cpdt commented Jun 30, 2020

Hey, thanks so much for looking into it! Yeah, it doesn't look like TextPluginName events are handled in this library, I'll look at adding support for that. Again, thank you for your help with this!

@NostalgiaRunner
Copy link
Author

Anytime. Glad I could help! Stay safe.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants