-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 232 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.h | 1 |
2 files changed, 149 insertions, 84 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index ae5cf0c..e6c4ff9 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -72,64 +72,122 @@ int seq = 0; static char * vmemo_xpm[] = { -"14 14 47 1", +"16 16 102 2", " c None", -". c #101010", -"+ c #0D0D0D", -"@ c #0B0B0B", -"# c #393939", -"$ c #6C6C6C", -"% c #5D5D5D", -"& c #4E4E4E", -"* c #1C1C1C", -"= c #131313", -"- c #7B7B7B", -"; c #303030", -"> c #383838", -", c #3F3F3F", -"' c #343434", -") c #060606", -"! c #444444", -"~ c #646464", -"{ c #505050", -"] c #717171", -"^ c #1B1B1B", -"/ c #585858", -"( c #4C4C4C", -"_ c #353535", -": c #0E0E0E", -"< c #080808", -"[ c #262626", -"} c #121212", -"| c #7F7F7F", -"1 c #464646", -"2 c #0C0C0C", -"3 c #727272", -"4 c #292929", -"5 c #656565", -"6 c #565656", -"7 c #434343", -"8 c #272727", -"9 c #0F0F0F", -"0 c #3A3A3A", -"a c #090909", -"b c #535353", -"c c #545454", -"d c #494949", -"e c #7A7A7A", -"f c #202020", -"g c #3D3D3D", -"h c #1F1F1F", -" .+@ ", -" #$%&* ", -" =-;>,')", -" .$;!~,)", -" ;#{]!)", -" ^~/(_)", -" ./:@<[)", -" }. .|]1;;2 ", -" #-$;^/3&;;4@ ", -".$;;#5:67;89 ", -":%;0%&ab;8. ", -"@cd%e!fg49 ", -" h0,!_;2@ ", -" ))))) "}; +". c #60636A", +"+ c #6E6E72", +"@ c #68696E", +"# c #4D525C", +"$ c #6B6C70", +"% c #E3E3E8", +"& c #EEEEF2", +"* c #EAEAEF", +"= c #CACAD0", +"- c #474A51", +"; c #171819", +"> c #9B9B9F", +", c #EBEBF0", +"' c #F4F4F7", +") c #F1F1F5", +"! c #DEDEE4", +"~ c #57575C", +"{ c #010101", +"] c #A2A2A6", +"^ c #747477", +"/ c #B5B5B8", +"( c #AEAEB2", +"_ c #69696D", +": c #525256", +"< c #181C24", +"[ c #97979B", +"} c #A7A7AC", +"| c #B0B0B4", +"1 c #C8C8D1", +"2 c #75757B", +"3 c #46464A", +"4 c #494A4F", +"5 c #323234", +"6 c #909095", +"7 c #39393B", +"8 c #757578", +"9 c #87878E", +"0 c #222224", +"a c #414144", +"b c #6A6A6E", +"c c #020C16", +"d c #6B6B6F", +"e c #68686D", +"f c #5B5B60", +"g c #8A8A8F", +"h c #6B6B6E", +"i c #ADADB2", +"j c #828289", +"k c #3E3E41", +"l c #CFCFD7", +"m c #4C4C50", +"n c #000000", +"o c #66666A", +"p c #505054", +"q c #838388", +"r c #A1A1A7", +"s c #A9A9AE", +"t c #A8A8B0", +"u c #5E5E63", +"v c #3A3A3E", +"w c #BDBDC6", +"x c #59595E", +"y c #76767C", +"z c #373738", +"A c #717174", +"B c #727278", +"C c #1C1C1E", +"D c #3C3C3F", +"E c #ADADB6", +"F c #54555A", +"G c #8B8C94", +"H c #5A5A5F", +"I c #BBBBC3", +"J c #C4C4CB", +"K c #909098", +"L c #737379", +"M c #343437", +"N c #8F8F98", +"O c #000407", +"P c #2D3137", +"Q c #B0B1BC", +"R c #3B3C40", +"S c #6E6E74", +"T c #95959C", +"U c #74747A", +"V c #1D1D1E", +"W c #91929A", +"X c #42444A", +"Y c #22282E", +"Z c #B0B2BC", +"` c #898A90", +" . c #65656A", +".. c #999AA2", +"+. c #52535A", +"@. c #151B21", +"#. c #515257", +"$. c #B5B5BE", +"%. c #616167", +"&. c #1A1D22", +"*. c #000713", +"=. c #1F1F21", +" ", +" . + @ # ", +" $ % & * = - ", +" ; > , ' ) ! ~ ", +" { ] ^ / ( _ : ", +" < [ } | 1 2 3 ", +" 4 5 6 7 8 9 0 a b c ", +" d e f g h i j 3 k l m n ", +" o p q r s t u v w n ", +" o x y z A B C D E n ", +" F G H I J K L M N O ", +" P Q R S T U V W X ", +" Y Z ` b ...+. ", +" @.#.$.%.&. ", +" *.B =. ", +" n n n n n n n n n "}; + @@ -170,4 +228,3 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) QDataStream stream( data, IO_ReadOnly ); - if (msg == "toggleRecord()") - { + if (msg == "toggleRecord()") { if (recording) @@ -188,4 +245,3 @@ void VMemo::mousePressEvent( QMouseEvent *me ) // just to be safe - if (recording) - { + if (recording) { recording = FALSE; @@ -201,7 +257,15 @@ void VMemo::mousePressEvent( QMouseEvent *me ) +// Config config( "Sound" ); +// config.setGroup( "System" ); +// useAlerts = config.readBoolEntry("Alert"); + +// if(useAlerts) { +// if( QMessageBox::warning(this,"VMemo","Really Record?","Yes","No",0,0,1) ==1) +// return; +// } else { QSound::play(Resource::findSound("vmemob")); +// } qDebug("Start recording"); recording = TRUE; - if (openDSP() == -1) - { + if (openDSP() == -1) { QMessageBox::critical(0, "VMemo", "Could not open dsp device.", "Abort"); @@ -232,4 +296,3 @@ void VMemo::mousePressEvent( QMouseEvent *me ) - if(openWAV(fileName.latin1()) == -1) - { + if(openWAV(fileName.latin1()) == -1) { QString err("Could not open the output file: "); @@ -272,4 +335,3 @@ int VMemo::openDSP() resolution = 16; - } - else { + } else { format = AFMT_S8; @@ -278,2 +340,3 @@ int VMemo::openDSP() + if(systemZaurus) { @@ -347,3 +410,2 @@ void VMemo::record(void) signed short sound[512], monoBuffer[512]; - if(format==AFMT_S16_LE) { @@ -370,6 +432,6 @@ void VMemo::record(void) } - } - else { //AFMT_S8 // don't try this yet.. as player doesn't understand 8bit unsigned - while(recording) - { + } else { //AFMT_S8 +// 8bit unsigned + unsigned short sound[512], monoBuffer[512]; + while(recording) { result = read(dsp, sound, 512); // 8192 @@ -377,4 +439,3 @@ void VMemo::record(void) int j=0; - if(systemZaurus) - { + if(systemZaurus) { for (int i = 0; i < result; i++) { //since Z is mono do normally @@ -398,2 +459,4 @@ void VMemo::record(void) } + + qApp->processEvents(); } @@ -402,6 +465,5 @@ void VMemo::record(void) - char sound[512]; //char is 8 bit + signed short sound[512], monoBuffer[512]; - while(recording) - { + while(recording) { result = read(dsp, sound, 512); // 8192 @@ -414,2 +476,4 @@ void VMemo::record(void) } + printf("%d\r",length); + fflush(stdout); // qDebug("file has length of %d lasting %d seconds", @@ -429,5 +493,5 @@ void VMemo::record(void) ::close(dsp); - if(systemZaurus) - QMessageBox::message("Vmemo"," Done recording"); - +// if(useAlerts) +// QMessageBox::message("Vmemo"," Done recording"); +// else QSound::play(Resource::findSound("vmemoe")); diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h index d96cd94..f30476f 100644 --- a/core/applets/vmemo/vmemo.h +++ b/core/applets/vmemo/vmemo.h @@ -40,2 +40,3 @@ public slots: private: + bool useAlerts; void paintEvent( QPaintEvent* ); |