sequencer

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2006
Posts: 6
Reputation: ontrix is an unknown quantity at this point 
Solved Threads: 0
ontrix ontrix is offline Offline
Newbie Poster

sequencer

 
0
  #1
May 13th, 2006
hi there im having some problems, im trying to write a simple software sequencer in visual C++ under windows. I have a few problems my first two menus open up fine but the third wont open it just loops on the title menu. The second probelm i have is that all the sections dont play together any help would be great cheers ontrix code attached
Attached Files
File Type: txt code.txt (24.5 KB, 3 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: sequencer

 
0
  #2
May 13th, 2006
You really need to discover the magic of
a) indentation
b) functions.

A 800+ lines of code in main(), c'mon be serious.
Nobody is going to wade through that lot just to spot what might be wrong.

A rough rule of thumb - if you can't see the entire function on screen at the same time (from it's opening brace to it's closing brace), then it's probably too big to manage.

I bet all those header files have code inside them as well right?

How about a separate function for each top-level menu choice.

>> snipped from the code...
  1. float edit_instrument1[5]; //edit the instrument for a note
  2. Instrmnt *instrument1 = 0; // This variable will hold the instrument information
  3. // snip
  4. float edit_instrument2[5]; //edit the instrument for a note
  5. Instrmnt *instrument2 = 0; // This variable will hold the instrument information
Why isn't this screaming at you to be
a) a struct containing several things
b) an array of that struct.
That would cut down significantly on the number of variables you have.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC