Home » Developing U++ » UppHub » More new functions
Re: More new functions [message #18834 is a reply to message #18804] |
Sun, 26 October 2008 01:19   |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
Thank you for the feedback. First I inclose you a screengrab of a program I am doing that uses these functions. It is very preliminary but it runs:

With this program I drag-drop movie clips in a main track that I convert in DVD format mpg files:
- With LaunchCommand(const char *cmd, String &ret); I get the video images you see in the center-left side column using mplayer
- With LaunchCommand(const char *cmd, void (*readCallBack)(String &)); I get the final .mpg DVD compatible file using mencoder. All the mencoder output goes to a function that sends it to a window (in the screengrab). If the window is closed, it kills the process before.
Coming to the comments:
- You are right: I have to change LaunchCommand in case of non GUI program to not call Ctrl::ProcessEvents();
- Ctrl::ProcessEvents(); lets the main GUI program to follow doing other things and being responsive to user without stoping the process. The command runs in another thread and the main GUI program only gets its output.
It is not perfect multithread, but it works well.
- In LaunchCommand, for example, to join to files, I would do LaunchCommand("mencoder a.avi b.avo -oac copy -ovc copy - ab.avi", myfun);
a basic myfun would be like:
void myfun(String &s)
{
MySendStrToCommandWindow(s);
MyParseStrToMoveProgressBar(s);
}
About the functions, I have prepared more but before finishing them I would like to ask you if putting them in different functions or declaring them into classes like:
class SysFolders // Special folders
String GetDesktop();
String GetPrograms();
String GetAppData();
String GetMusic();
String GetPictures();
String GetVideo();
String GetPersonal();
String GetTemplates();
String GetDownload();
String GetRoot(); // New
String GetTemp(); // New
Possible new functions to change folders
class SysOS // OS info. Samples after //
String GetName(); // Windows Linux
String GetCode(); // 6.0 2.6.8-1.523
String GetVersion(); // Vista Ubuntu
String GetRelease(); // Home Premium Edition 8.04
String GetSize(); // 64-bit 32-bit
class SysCPU //CPU info
String GetIdentifier();
String GetLevel();
String GetRevision();
String GetArchitecture;
String GetSpeed();
String GetNumber();
Possible new functions to get more details
class SysProcesses //Current processes info.
bool Update(); // Gets processes info
bool GetFirst(int processId, String pName);
vool GetNext(int processId, String pName);
Possible new functions to kill processes or change priority
I have seen in Upp that it tends to not create new classes with grouped static functions inside, but doing alone functions. What do you prefer ?
Best regards
Koldo
Best regards
IƱaki
|
|
|
 |
|
More new functions
By: koldo on Wed, 22 October 2008 23:25
|
 |
|
Re: More new functions
By: tojocky on Thu, 23 October 2008 07:35
|
 |
|
Re: More new functions
By: captainc on Fri, 24 October 2008 01:22
|
 |
|
Re: More new functions
By: koldo on Fri, 24 October 2008 08:11
|
 |
|
Re: More new functions
By: captainc on Fri, 24 October 2008 14:05
|
 |
|
Re: More new functions
By: mrjt on Fri, 24 October 2008 15:28
|
 |
|
Re: More new functions
By: koldo on Sun, 26 October 2008 01:19
|
 |
|
Re: More new functions
By: captainc on Sun, 26 October 2008 02:03
|
 |
|
Re: More new functions
By: koldo on Sun, 26 October 2008 10:19
|
 |
|
Re: More new functions
By: koldo on Thu, 30 October 2008 08:24
|
 |
|
Re: More new functions
By: mirek on Fri, 31 October 2008 13:34
|
 |
|
Re: More new functions
By: cocob on Fri, 31 October 2008 10:44
|
 |
|
Re: More new functions
By: koldo on Fri, 31 October 2008 13:25
|
 |
|
Re: More new functions
By: koldo on Fri, 31 October 2008 15:51
|
 |
|
Re: More new functions
|
 |
|
Re: More new functions
By: koldo on Thu, 13 November 2008 09:15
|
 |
|
Re: More new functions
By: koldo on Wed, 19 November 2008 08:09
|
 |
|
Re: More new functions
By: koldo on Wed, 19 November 2008 17:44
|
 |
|
Re: More new functions
By: tojocky on Thu, 20 November 2008 10:35
|
 |
|
Re: More new functions
By: koldo on Thu, 20 November 2008 14:18
|
 |
|
Re: More new functions
By: tojocky on Fri, 21 November 2008 07:40
|
 |
|
Re: More new functions
By: koldo on Fri, 21 November 2008 08:17
|
 |
|
Re: More new functions
By: tojocky on Fri, 21 November 2008 13:25
|
 |
|
Re: More new functions
By: koldo on Fri, 21 November 2008 16:13
|
 |
|
Re: More new functions
By: koldo on Fri, 21 November 2008 22:24
|
 |
|
Re: More new functions
By: tojocky on Sat, 22 November 2008 08:32
|
 |
|
Re: More new functions
By: koldo on Sat, 22 November 2008 23:24
|
 |
|
Re: More new functions
By: tojocky on Sun, 23 November 2008 07:58
|
 |
|
Re: More new functions
By: mirek on Sun, 23 November 2008 10:45
|
 |
|
Re: More new functions
By: koldo on Sun, 23 November 2008 16:20
|
 |
|
Re: More new functions
By: mirek on Sun, 23 November 2008 18:23
|
 |
|
Re: More new functions
By: koldo on Sun, 23 November 2008 20:08
|
 |
|
Re: More new functions
By: koldo on Mon, 24 November 2008 00:28
|
 |
|
Re: More new functions
By: koldo on Wed, 03 December 2008 09:30
|
 |
|
Re: More new functions
By: mirek on Mon, 15 December 2008 10:07
|
 |
|
Re: More new functions
By: koldo on Wed, 17 December 2008 08:33
|
 |
|
Re: More new functions
By: koldo on Sat, 17 January 2009 22:32
|
 |
|
Re: More new functions
|
 |
|
Re: More new functions
By: koldo on Sat, 25 December 2010 10:05
|
Goto Forum:
Current Time: Thu May 08 07:51:09 CEST 2025
Total time taken to generate the page: 0.02801 seconds
|