Here are my diffs for the song class and header. I will try to separate the 
timer from the visualization widget I sent to you, sorry if it is a mess, but I 
am a beginner on git.

What I think is relevant are these diffs:
Song.cpp:
113c111,115
465a465,483
608a627,629

Song.h
96c96,115
289a292,296

> Date: Wed, 23 May 2012 08:56:05 +0200
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [LMMS-devel] Concept for a time widget
> 
> Hi Rubén,
> 
> 2012/5/23 Rubén Ibarra Pastor <[email protected]>:
> > Well, I am programming a timer widget for lmms so it can show the position
> > of a song while it is playing. For now, play and stop are implemented, this
> > code is based on lmms-0.4.13, in processNextBuffer from song.h. The widget
> > is based on visualization widget, it shows minutes, seconds and milliseconds
> > as it shows tacks, ticks, and milliseconds for now, but I think it should
> > show frames. This is a partial implementation but I send it to you to ask if
> > this is acceptable, and what polishing should be done to the code.
> 
> Does it also work when moving playback cursor to an arbitrary
> position, i.e. respects tempo automation? Because this only has been a
> big issue and the reason it was not implemented yet. However for the
> beginning, every approach is welcome! :-)
> 
> Can you please provide a patch/diff ("git diff" should do the job) so
> that changes can be incorporated/tested more easily - independent of
> current Git HEAD?
> 
> Best regards
> 
> Toby
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> LMMS-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lmms-devel
                                          
36d35
< #include "AutomationRecorder.h"
45c44
< #include "ExportProjectDialog.h"
---
> #include "export_project_dialog.h"
85d83
< 	m_export_loop( false ),
113c111,115
< 
---
> 	elapsedminutes = 0;
> 	elapsedseconds = 0;
> 	elapsedmilliseconds = 0;
> 	elapsedticks = 0;
> 	elapsedtacts = 0;
169,171d170
< 
< 
< 
465a465,483
> 		elapsedseconds += (((played_frames/frames_per_tick)*60/48)/getTempo());
> 		elapsedmilliseconds += (((played_frames/frames_per_tick)*60*100/48)/getTempo());
> 		//elapsedmilliseconds += ((played_frames/frames_per_tick)*60*100/48)/getTempo();
> 		if(elapsedseconds >= 60)
> 		{
> 			elapsedseconds -= 60;
> 			elapsedminutes++;
> 		}
> 		if(elapsedmilliseconds>100)
> 		{
> 			elapsedmilliseconds -= 100;
> 		}
> 		if(elapsedseconds > 60)
> 		{
> 			elapsedseconds = ((m_playPos[m_playMode].getTicks()*60)/(getTempo()*48))%60; // Calcula segundos
> 			elapsedminutes++;
> 		}
> 		elapsedtacts = m_playPos[Mode_PlaySong].getTact();
> 		elapsedticks = (m_playPos[Mode_PlaySong].getTicks()%ticksPerTact())/48;
608a627,629
> 	elapsedminutes = 0;
> 	elapsedseconds = 0;
> 	elapsedmilliseconds = 0;
610,611d630
< 
< 	engine::automationRecorder()->initRecord();
653d671
< 	m_export_loop = false;
745,746d762
< 	engine::fxMixer()->clear();
< 
755,756d770
< 
< 	// depends on the fxMixer being cleared
761d774
< 
766c779
< 
---
> 	engine::fxMixer()->clear();
931,950d943
< 
< 	// walk through and fix up the mixer
< 	while( !node.isNull() )
< 	{
< 		if( node.nodeName() == engine::fxMixer()->nodeName() )
< 		{
< 			engine::fxMixer()->restoreState( node.toElement() );
< 
< 			if( engine::hasGUI() )
< 			{
< 				// refresh FxMixerView
< 				engine::fxMixerView()->refreshDisplay();
< 			}
< 		}
< 
< 		node = node.nextSibling();
< 	}
< 
< 	node = mmp.content().firstChild();
< 
963a957,960
> 			else if( node.nodeName() == engine::fxMixer()->nodeName() )
> 			{
> 				engine::fxMixer()->restoreState( node.toElement() );
> 			}
1015a1013
> 
1124,1126d1121
< #ifdef LMMS_HAVE_ZIP	
< 				" *.zip);;" +
< #else 
1128d1122
< #endif
1213c1207
< 		ExportProjectDialog epd( export_file_name,
---
> 		exportProjectDialog epd( export_file_name,
96c96,115
< 
---
> 	inline int getSeconds() const
> 	{
> 		return elapsedseconds;
> 	}
> 	inline int getMinutes() const
> 	{
> 		return elapsedminutes;
> 	}
> 	inline int getMilliseconds() const
> 	{
> 		return elapsedmilliseconds;
> 	}
> 	inline int getTacts() const
> 	{
> 		return elapsedtacts;
> 	}
> 	inline int getTicks() const
> 	{
> 		return elapsedticks;
> 	}
114,118d132
< 	inline void setExportLoop(bool export_loop)
< 	{
< 		m_export_loop = export_loop;
< 	}
< 
128,137c142,143
< 		if ( m_export_loop )
< 		{
< 			return m_exporting == true &&
< 				m_playPos[Mode_PlaySong].getTact() >= length();
< 		}
< 		else
< 		{
< 			return m_exporting == true &&
< 				m_playPos[Mode_PlaySong].getTact() >= length() + 1;
< 		}
---
> 		return m_exporting == true &&
> 			m_playPos[Mode_PlaySong].getTact() >= length() + 1;
210,214c216
< 	inline void toggleLoopPoints( int _mode )
< 	{
< 		emit loopPointsChanged( _mode );
< 	}
< 	
---
> 
289a292,296
> 	int elapsedminutes; //Minutos transcurridos
> 	float elapsedseconds; //Segundos transcurridos
> 	float elapsedmilliseconds; //Milisegundos transcurridos
> 	int elapsedticks;
> 	int elapsedtacts;
302d308
< 	volatile bool m_export_loop;
332c338
< 	friend class MainWindow;
---
> 	friend class mainWindow;
341c347
< 	void loopPointsChanged( int _mode );
---
> 
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
LMMS-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmms-devel

Reply via email to