تحويل كود من السي الى الدلفي
#4
شكرا حقيقه لم افلح هذا الكود كاملا في السي
كود :
// scan the peaks void __cdecl ScanPeaks(void *p) { DWORD decoder=(DWORD)p; DWORD pos=0; float spp=BASS_ChannelBytes2Seconds(decoder,bpp); // seconds per pixel while (!killscan) { float peak[2]; if (spp>1) { // more than 1 second per pixel, break it down... float todo=spp; peak[1]=peak[0]=0; do { float level[2],step=(todo<1?todo:1); BASS_ChannelGetLevelEx(decoder,level,step,BASS_LEVEL_STEREO); // scan peaks if (peak[0]<level[0]) peak[0]=level[0]; if (peak[1]<level[1]) peak[1]=level[1]; todo-=step; } while (todo>0); } else BASS_ChannelGetLevelEx(decoder,peak,spp,BASS_LEVEL_STEREO); // scan peaks { DWORD a; for (a=0;a<peak[0]*(HEIGHT/2);a++) wavebuf[(HEIGHT/2-1-a)*WIDTH+pos]=1+a; // draw left peak for (a=0;a<peak[1]*(HEIGHT/2);a++) wavebuf[(HEIGHT/2+1+a)*WIDTH+pos]=1+a; // draw right peak } pos++; if (pos>=WIDTH) break; // reached end of display if (!BASS_ChannelIsActive(decoder)) break; // reached end of channel } if (!killscan) { DWORD size; BASS_ChannelSetPosition(decoder,(QWORD)-1,BASS_POS_BYTE|BASS_POS_SCAN); // build seek table (scan to end) size=BASS_ChannelGetAttributeEx(decoder,BASS_ATTRIB_SCANINFO,0,0); // get seek table size if (size) { // got it void *info=malloc(size); // allocate a buffer BASS_ChannelGetAttributeEx(decoder,BASS_ATTRIB_SCANINFO,info,size); // get the seek table BASS_ChannelSetAttributeEx(chan,BASS_ATTRIB_SCANINFO,info,size); // apply it to the playback channel free(info); } } BASS_StreamFree(decoder); // free the decoder scanthread=0; }
سبحان الله و بحمده سبحان الله العظيم
الرد


الردود في هذا الموضوع
تحويل كود من السي الى الدلفي - بواسطة Anew - 28-01-2015, 08:52 PM
تحويل كود من السي الى الدلفي - بواسطة phpbb3 - 29-01-2015, 01:46 PM
تحويل كود من السي الى الدلفي - بواسطة Anew - 29-01-2015, 02:00 PM
تحويل كود من السي الى الدلفي - بواسطة Anew - 29-01-2015, 02:54 PM
تحويل كود من السي الى الدلفي - بواسطة Anew - 30-01-2015, 10:04 AM
تحويل كود من السي الى الدلفي - بواسطة phpbb3 - 30-01-2015, 12:32 PM
تحويل كود من السي الى الدلفي - بواسطة Anew - 30-01-2015, 03:56 PM
تحويل كود من السي الى الدلفي - بواسطة phpbb3 - 29-01-2015, 06:29 AM
تحويل كود من السي الى الدلفي - بواسطة Anew - 29-01-2015, 10:46 AM
تحويل كود من السي الى الدلفي - بواسطة phpbb3 - 29-01-2015, 11:44 AM
تحويل كود من السي الى الدلفي - بواسطة Anew - 29-01-2015, 12:43 PM
تحويل كود من السي الى الدلفي - بواسطة Anew - 31-01-2015, 01:17 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم