Skip to content

Commit

Permalink
Fix #901 Audacity timing tracks with label of '#' not being imported …
Browse files Browse the repository at this point in the history
…correctly
  • Loading branch information
Keith Westley committed Aug 23, 2017
1 parent 8f95d35 commit 73c74d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xLights/xLightsXmlFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,8 +1495,13 @@ void xLightsXmlFile::ProcessAudacityTimingFiles(const wxString& dir, const wxArr

for(r=0, line = f.GetFirstLine(); !f.Eof(); line = f.GetNextLine(), r++)
{
std::string::size_type ofs;
if ((ofs = line.find("#") != std::string::npos)) line.erase(ofs); //remove comments
// remove comments
if (line.Contains("#"))
{
int pos = line.Find("#");
line.Truncate(pos);
}

while (!line.empty() && (line.Last() == ' ')) line.RemoveLast(); //trim trailing spaces
if (line.empty())
{
Expand Down

4 comments on commit 73c74d2

@AzGilrock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? All my labels in Audacity are like "Beat #1", "Beat #2", etc...
LOL...just kidding but I can see it coming... ;)

@keithsw1111
Copy link
Collaborator

@keithsw1111 keithsw1111 commented on 73c74d2 Aug 23, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AzGilrock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was joking. But any idea why a # sign blows things up?

@keithsw1111
Copy link
Collaborator

@keithsw1111 keithsw1111 commented on 73c74d2 Aug 23, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.