Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - spostare la  dichiarazione
Forum - Visual Basic 6 - spostare la dichiarazione "private type ... " dalla sezione dichiarazione ad una subroutine

Pagine: [ 1 2 ] Precedente | Prossimo
Avatar
iz1kbp (Normal User)
Rookie


Messaggi: 26
Iscritto: 29/02/2020

Segnala al moderatore
Postato alle 23:14
Venerdì, 05/02/2021
Buongiorno a tutti.
Ho una utility ,non mia, trovata nel web, che mi permette di estrarre l'inviluppo (forma d'onda) di un file wave.L'utility è molto vecchia ma funziona bene.Il mio problema è che ai tempi i file wave erano sostanzialmente nel formato cd (44100, 16bt, stereo).Ora purtroppo devo operare con file wave di formati differenti, ed in particolare con 48000, 16bt, stereo.
Ho trovato il modo di far leggere correttamente i due formati modificando questa sezione di codice che si trova nella sezione DICHIARAZIONI del form che fa il lavoro di estrazione.

Al posto di 882 metto 960
Codice sorgente - presumibilmente Delphi

  1. '----------------------------------------------------------
  2. ' 882 deriva da:
  3. '   44100 = 1 secondo
  4. '   441   = 1/100 secondi         > per 48Mhz :480
  5. '   882   = 441 * 2 (2 = stereo)   > per 48MHz :960
  6. '----------------------------------------------------------
  7. Private Type WAVEBLOCK
  8.     wavinfo(1 To 882) As Integer
  9. End Type



Io riesco a leggere  la frequenza di campionamento del file nel momento in cui lo carico e mi occorrerebbe, che il dato (882 nel caso sopra) possa essere modificato nel momento in cui carico il file wave.
Ho provato a mettere un IF nella mia sub che carica il file wave ma non fuziona.
Qualcuno mi sa indicare se è possibile eseguire la funzione sopra,non all'avvio del form come avviene ora,ma all'interno di un subroutine come ad esempio
Codice sorgente - presumibilmente Delphi

  1. If  samplerate = 44100 Then
  2.             ...modifico in 882
  3.             Label25.Caption = "44100"
  4.        
  5.         Else
  6.             ...modifico in 960
  7.             Label25.Caption = "48000"
  8.        
  9.     End If



Questo per pemettermi di caricare indistintamente file a 44100 e 48000 di sample rate.
Nella situazione attuale, per caricare uno o l'altro devo uscire dal programma, modficare il dato via codice e ripartire.
Spero di essermi spiegato in maniera comprensibile.

Grazie a chiunque possa illuminarmi

mario
;)

PM Quote
Avatar
nessuno (Normal User)
Guru^2


Messaggi: 6379
Iscritto: 03/01/2010

Segnala al moderatore
Postato alle 9:20
Sabato, 06/02/2021
Imposta nel codice due strutture diverse e usa quella che ti serve al momento


Ricorda che nessuno è obbligato a risponderti e che nessuno è perfetto ...
---
Il grande studioso italiano Bruno de Finetti (uno dei padri fondatori del moderno Calcolo delle probabilità) chiamava il gioco del Lotto Tassa sulla stupidità.
PM Quote
Avatar
Carlo (Member)
Guru


Messaggi: 1315
Iscritto: 29/01/2018

Segnala al moderatore
Postato alle 11:00
Sabato, 06/02/2021
quando carichi il file wave, lo devi analizzare, in base al responso metti in una variabile il valore voluto
in vb6 per analizzare il file puoi usare Shell32.dll:
http://www.pierotofy.it/pages/sorgenti/dettagli/19629-INFO ...
è in VB .Net ma il concetto è lo stesso.

Altra possibilità più semplice è mettere due OptionButton, uno che si chiama 44,1KHz e l'altro 48,0KHz quando l'optionbutton viene cliccato cambi il valore della variabile e richiami la routine che crea la forma d'onda.

Il codice con l'If che hai proposto, da solo non è sufficiente, non conosco le tue competenze in VB6, se hai difficoltà posta il codice completo.


in programmazione tutto è permesso
PM Quote
Avatar
iz1kbp (Normal User)
Rookie


Messaggi: 26
Iscritto: 29/02/2020

Segnala al moderatore
Postato alle 11:15
Sabato, 06/02/2021
Ciao Carlo, grazie per il replay.
LE mie conoscenze vb6 sono abbastanza "basiche". Il file wav riesco ad analizzarlo senza problemi, infatti la mia intenzione era, leggendo il sample rate, quella di automatizzare il dimensionamento di quel numero.
Questa è la parte di dichiarazione al boot del form
Codice sorgente - presumibilmente VB.NET

  1. Option Explicit
  2. Private riga As Integer
  3. Dim wavtoshow As String
  4. Dim play As Boolean
  5. Dim a As Integer
  6. Dim pos ' posizione cursore in edit
  7. Dim edit
  8. Dim lung As String
  9. Dim accss As String
  10. Dim Posizione As Long ' posizione del cursone nella grafica
  11. Dim totale As Long ' totale lunghezza della linea nella grafica
  12. Dim errore As Integer
  13. Dim ritardo As Integer 'varibili per timer 2
  14. Dim attendi As Integer 'variabili per  timer 2 attendoi  di arrivare a ritardo
  15. Dim proseguo As Integer 'se rver per sapere se prosegue la cattura
  16. Dim annullata As Integer 'procedura di carico wave annullata per evitare di inizilizzare griglia
  17. Private Declare Function MoveToEx Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, lpPoint As Any) As Long
  18. Private Declare Function LineTo Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long) As Long
  19. Private Declare Function GetShortPathNameAPI Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
  20. Private Const MAX_PATH As Long = 260
  21. Private Type WAVEFMT
  22.     signature As String * 4     ' must contain 'RIFF'
  23.     RIFFsize As Long            ' size of file (in bytes) minus 8
  24.     type As String * 4          ' must contain 'WAVE'
  25.     fmtchunk As String * 4      ' must contain 'fmt ' (including blank)
  26.     fmtsize As Long             ' size of format chunk, must be 16
  27.     format As Integer           ' normally 1 (PCM)
  28.     Channels As Integer         ' number of channels, 1=mono, 2=stereo
  29.     samplerate As Long          ' sampling frequency: 11025, 22050 or 44100
  30.     average_bps As Long         ' average bytes per second; samplerate * channels
  31.     align As Integer            ' 1=byte aligned, 2=word aligned
  32.     BitsPerSample As Integer    ' should be 8 or 16
  33.     datchunk As String * 4      ' must contain 'data'
  34.     samples As Long             ' number of samples
  35. End Type
  36.  
  37. Private Type POINT
  38.     X As Long
  39.     Y As Long
  40. End Type
  41.  
  42. '----------------------------------------------------------
  43. ' 882 comes from:
  44. '   44100 = 1 second
  45. '   441   = 1/100 second
  46. '   882   = 441 * 2 (2 = stereo)
  47. '----------------------------------------------------------
  48. Private Type WAVEBLOCK
  49.     'wavinfo(1 to 882) As Integer -----
  50. wavinfo() as integer ' mia modifica per cercare di modificarlo al momento del caircamento del file wave
  51. End Type
  52.  
  53. Private Type SCROLLER
  54.     Min As Long
  55.     Max As Long
  56.     Value As Long
  57.     topval As Long  'Position represented by top line of wavform
  58. End Type
  59.  
  60. Dim nomefileaudio As String
  61. Dim fil As String
  62. Dim WavCount As Long, WavMin() As Integer, WavMax() As Integer
  63. Dim ttt As WAVEBLOCK, LastPt As POINT, VScroll As SCROLLER
  64. Dim WavSpeed As Integer
  65. Dim delete As Boolean
  66. ' The column selected for sorting.
  67. Private m_SortColumn As Integer
  68. ' The current sort order.
  69. Private m_SortOrder As SortSettings
  70. Dim cancellariga As Integer
  71. Dim copia As Boolean
  72. Dim voltemp As Integer
  73. Dim prima, dopo As Integer 'nel caso di edit con S sono il dato prima e dopo la correzzione
  74. 'Dim finewavcount As Integer
  75. Dim finewavcount As Long
  76. Dim lunghezza As Integer
  77. Dim nibblelf, nibblehf As Long
  78. Dim nibblels, nibblehs As Long
  79. Dim nibblelm, nibblehm As Long
  80. Dim nibblelh, nibblehh As Long
  81. Dim exframe, exsecondi, exminuti, exore, ll, hh As String


Quel valore che assume wave info (882) viene poi ripreso dalla variabile ttt.

questo il codice che mi carica il file wav
Codice sorgente - presumibilmente VB.NET

  1. Dim t1 As Long, tmin As Integer, tmax As Integer
  2.     Dim wavh As WAVEFMT
  3.    
  4.     With CM
  5.         .FileName = vbNullString
  6.         .InitDir = App.path & "\cartelle\WAV"
  7.         .FileName = ""
  8.         .Filter = "Audio Wav(*.wav)|*.wav"
  9.         .ShowOpen
  10.         fil = .FileName
  11.         percorsomarcatori = .FileName
  12.         If fil = "" Then
  13.                         MsgBox "Annullata da utente"
  14.                         annullata = 1
  15.                         Exit Sub
  16.         End If
  17.         '------------------------------------------
  18.        
  19.         lung = Len(fil)
  20.             Dim l1 As Integer
  21.             Dim l2 As Integer
  22.             For n = 1 To lung
  23.                 If Mid(fil, n, 4) = "\WAV" Then l1 = n + 5
  24.                 If Mid(fil, n, 1) = "." Then l2 = n
  25.             Next
  26.             If l1 = 0 Then
  27.                         MsgBox "Importare il file WAVE tramite procedura", vbExclamation, "XLight IV - Importare file wave"
  28.                         Close
  29.                         errore = 1
  30.                         Exit Sub
  31.             End If
  32.         accss = Mid(fil, l1, l2 - l1)
  33.         wavtoshow = accss
  34.         '----------------------------------------
  35.         Me.Caption = "XLIGHT IV - " & accss
  36.     End With
  37.     Me.Refresh  'Do this to remove lingering dialog box lines
  38.     If fil = "" Then Exit Sub
  39.     If Dir(fil, vbNormal) = "" Then Exit Sub
  40.    
  41.     MP.FileName = fil
  42.     MP.Stop
  43.     '-----------------------------------------
  44.     '  Only allow wavh.bitspersample = 16!!!
  45.     '-----------------------------------------
  46.     Open fil For Binary Access Read As #1
  47.     Get #1, , wavh
  48. '[b]-----mia modifica per cercare di impostare il valore in base al formato[/b]
  49.     If wavh.samplerate = 44100 Then
  50.          ReDim wavinfo(1 To 960) As Integer
  51.      Else
  52.         ReDim wavinfo(1 To 820) As Integer
  53.     End If
  54.  '[b]---------------------fine mia modifica [/b]  
  55.     WavCount = wavh.samples \ Len(ttt)
  56.    
  57.     ReDim WavMin(WavCount), WavMax(WavCount)
  58.    
  59.     Screen.MousePointer = vbHourglass
  60. 'Dim extraaudio As Integer
  61.     ProgressBar1.Max = WavCount
  62.     finewavcount = WavCount
  63.     ProgressBar1.Value = 0
  64.     ProgressBar1.Visible = True
  65.    
  66.     WavCount = -1
  67.     Do
  68.         Get #1, , ttt



PM Quote
Avatar
Carlo (Member)
Guru


Messaggi: 1315
Iscritto: 29/01/2018

Segnala al moderatore
Postato alle 12:08
Sabato, 06/02/2021
Si, ma per agevolarmi il compito, allega uno zip con il progetto che funziona, per fare una cosa fatta bene bisogna implementare il 48000, che non è contamplato in:
Codice sorgente - presumibilmente Visual Basic 6

  1. samplerate As Long          ' sampling frequency: 11025, 22050 or 44100


metti anche la riga che ti fa funzionare il codice a 48000 remmata, e l'originale no.



in programmazione tutto è permesso
PM Quote
Avatar
iz1kbp (Normal User)
Rookie


Messaggi: 26
Iscritto: 29/02/2020

Segnala al moderatore
Postato alle 13:07
Sabato, 06/02/2021
Grazie Carlo.
Ti allego i file originali (waveplay.vbp) dato che nel programma che ho sviluppato, ho dovuto implementarlo modificandolo sostanzialmente per esigenze mie funzioni che necessitano di altri programmi esterni e/o periferiche che altrimenti andrebbero installate.
ma comunque la parte che interessa  si vede gia in partenza.
Ho allegato anche due piccoli file wave , uno a 44khz ed uno a 48 khz.
Scopo di questo codice è caricare un file wave e rappresentare la sua forma d'onda (approssimata in mono) in un player.Quando si schiaccia play la forma d'onda scorre.la linea rossa rappresenta il campione che viene eseguito in quel momento.
A prima vista, senza modifiche di codice, i file vengono caricati senza problemi.
Cosa fare:
Con impostato 882 (default), carica il file test_44 e vedrai, facendo il play, che gli eventi sonori (sono dei semplici  beep) partono esattamente appena intersecano la linea rossa.
carica successivamento il file test_48 e fai il play. Noterai che gli eventi sonori partiranno sempre piu in ritardo rispetto alla linea rossa.
Se cambi da 882 con 916, avrai il comportamento contrario.

Dato che da codice (waveh.samplerate) riesco a capire che tipo di codifica ha il file, all'atto del LOAD FILE, volevo che il numero 882 o 960 venisse messo in automatico in modo da poter caricare indifferentemente un file anziche l'altro.
Cosi come è adesso ,devo ogni volta ricompilare ed eseguire il programma e riesco a visualizzare correttamento solo un tipo di file


iz1kbp ha allegato un file: waveplay.zip (721966 bytes)
Clicca qui per scaricare il file
PM Quote
Avatar
Carlo (Member)
Guru


Messaggi: 1315
Iscritto: 29/01/2018

Segnala al moderatore
Postato alle 19:38
Sabato, 06/02/2021
La matrice wavinfo fa parte della variabile definita come tipo WAVEBLOCK, che poi viene assegnata alla variabile ttt.
Tali designazioni pubbliche avvengono in fase di dichiarazione, per cui se ridimensioni la matrice waveinfo in runtime, la modifica non si riperquoterà in ttt
Ritengo che ci sia un metodo per ottenere quanto da te richiesto, ma ammetto che in VB6 non mi è mai capitato di doverlo fare, anche perché la doppia designazione è inutile, è sufficiente dichiarare solo ttt.
Il codice seguente funziona, ma è gradita la conferma.

ATTENZIONE nel codice  le righe:
' TimeDisplay.SetVal 0, 0, WavCount   'Parameters: value, min, max
' TimeDisplay.SetVal VScroll.value
le ho remmate perché nel mio VB6 l'user control non funziona e non ho impiegato tempo per capire perché

Codice sorgente - presumibilmente VB.NET

  1. Option Explicit
  2.  
  3. Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As Any) As Long
  4. Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
  5.  
  6. Private Type WAVEFMT
  7.     signature As String * 4     ' must contain 'RIFF'
  8.     RIFFsize As Long            ' size of file (in bytes) minus 8
  9.     type As String * 4          ' must contain 'WAVE'
  10.     fmtchunk As String * 4      ' must contain 'fmt ' (including blank)
  11.     fmtsize As Long             ' size of format chunk, must be 16
  12.     format As Integer           ' normally 1 (PCM)
  13.     channels As Integer         ' number of channels, 1=mono, 2=stereo
  14.     samplerate As Long          ' sampling frequency: 11025, 22050 or 44100
  15.     average_bps As Long         ' average bytes per second; samplerate * channels
  16.     align As Integer            ' 1=byte aligned, 2=word aligned
  17.     bitspersample As Integer    ' should be 8 or 16
  18.     datchunk As String * 4      ' must contain 'data'
  19.     samples As Long             ' number of samples
  20. End Type
  21.  
  22. Private Type POINT
  23.     x As Long
  24.     y As Long
  25. End Type
  26.  
  27. '----------------------------------------------------------
  28. ' 882 comes from:
  29. '   44100 = 1 second
  30. '   441   = 1/100 second
  31. '   882   = 441 * 2 (2 = stereo)
  32. '----------------------------------------------------------
  33. ' eliminata dichiarazione tipo WAVEBLOCKS
  34.  
  35. Private Type SCROLLER
  36.     min As Long
  37.     max As Long
  38.     value As Long
  39.     topval As Long  'Position represented by top line of wavform
  40. End Type
  41.  
  42. Dim Fil As String
  43. Dim WavCount As Long, WavMin() As Integer, WavMax() As Integer
  44. Dim ttt() As Integer ' ttt può essere direttamente la matrice ridimensionabile
  45. Dim LastPt As POINT
  46. Dim VScroll As SCROLLER
  47. Dim WavSpeed As Integer
  48.  
  49. Private Sub cmdOpen_Click()
  50.     LoadWaveForm
  51. End Sub
  52.  
  53. Private Sub Command1_Click()
  54.     MP.CurrentPosition = MP.CurrentPosition + 0.01
  55. End Sub
  56.  
  57. Private Sub Form_Load()
  58.     LabStatus = ""
  59.     WavSpeed = 50   'Default value for Speed Change button
  60.     SlideSpeed.value = 100
  61.     SlideVolume.value = 100
  62.     SlideBalance.value = 0
  63. End Sub
  64.  
  65. Private Sub Form_Unload(Cancel As Integer)
  66.     MP.FileName = ""
  67. End Sub
  68.  
  69.  
  70. Private Sub PicWave_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  71.     MP.CurrentPosition = (VScroll.topval + x) / 100
  72.     VScroll.value = VScroll.topval + x
  73. End Sub
  74.  
  75. Private Sub LoadWaveForm()
  76.     Dim t1 As Long, tmin As Integer, tmax As Integer
  77.     Dim wavh As WAVEFMT
  78.    
  79.     With CM
  80.         .FileName = ""
  81.         .Filter = "Wav(*.wav)|*.wav"
  82.         .ShowOpen
  83.         Fil = .FileName
  84.     End With
  85.     Me.Refresh  'Do this to remove lingering dialog box lines
  86.     If Fil = "" Then Exit Sub
  87.     If Dir(Fil, vbNormal) = "" Then Exit Sub
  88.    
  89.     MP.FileName = Fil
  90.  
  91.     '-----------------------------------------
  92.     '  Only allow wavh.bitspersample = 16!!!
  93.     '-----------------------------------------
  94.     Open Fil For Binary Access Read As #1
  95.     Get #1, , wavh
  96.     frmMain.Caption = wavh.samplerate
  97.     If wavh.samplerate = 44100 Then
  98.         ReDim ttt(1 To 882) As Integer
  99.     Else
  100.         ReDim ttt(1 To 960) As Integer
  101.     End If
  102.    
  103.     WavCount = wavh.samples \ UBound(ttt)
  104.     ReDim WavMin(WavCount), WavMax(WavCount)
  105.    
  106.     Screen.MousePointer = vbHourglass
  107.  
  108.     ProgressBar1.max = WavCount
  109.     ProgressBar1.value = 0
  110.     ProgressBar1.Visible = True
  111.    
  112.     WavCount = -1
  113.     Do
  114.         Get #1, , ttt
  115.         'Find min/max to get a better view of the wave
  116.         tmin = 0: tmax = 0
  117.         'Should look at all values but 'Step 32' speeds it up a bit
  118.         'A nice C++ function to find the max/min would be handy here!
  119.         For t1 = 1 To UBound(ttt) Step 32
  120.             tmin = IIf(ttt(t1) < tmin, ttt(t1), tmin)
  121.             tmax = IIf(ttt(t1) > tmax, ttt(t1), tmax)
  122.         Next t1
  123.         WavCount = WavCount + 1
  124.         WavMin(WavCount) = tmin \ 512 + 64  'Long values become +/-64 then
  125.         WavMax(WavCount) = tmax \ 512 + 64  'add 64 to make into co-ordinates
  126.        
  127.         If WavCount Mod 100 = 0 Then ProgressBar1.value = WavCount
  128.     Loop Until EOF(1)
  129.        
  130.     Close #1
  131.     ProgressBar1.Visible = False
  132.     ProgressBar1.value = 0
  133.  
  134.     VScroll.min = 0
  135.     VScroll.max = WavCount
  136.     VScroll.value = 0
  137.            
  138.    ' TimeDisplay.SetVal 0, 0, WavCount   'Parameters: value, min, max
  139.    
  140.     DrawWaveData
  141.     Screen.MousePointer = vbDefault
  142. End Sub
  143.  
  144. Private Sub PlaySpeed_Click()
  145.     SlideSpeed.value = IIf(SlideSpeed.value = 100, WavSpeed, 100)
  146. End Sub
  147.  
  148. Private Sub SlideBalance_Change()
  149.     MP.Balance = SlideBalance.value * 100   'Balance is +/- 10000
  150. End Sub
  151.  
  152. Private Sub SlideBalance_Scroll()
  153.     SlideBalance_Change
  154. End Sub
  155.  
  156. Private Sub SlideSpeed_Change()
  157.     If SlideSpeed.value <> 100 Then WavSpeed = SlideSpeed.value
  158.     frameSpeed.Caption = "Speed:" & SlideSpeed.value & "%"
  159. End Sub
  160.  
  161. Private Sub SlideSpeed_Scroll()
  162.     SlideSpeed_Change
  163. End Sub
  164.  
  165. Private Sub SlideVolume_Change()
  166.     frameVolume.Caption = "Volume:" & SlideVolume.value & "%"
  167. End Sub
  168.  
  169. Private Sub SlideVolume_Scroll()
  170.     SlideVolume_Change
  171. End Sub
  172.  
  173. Private Sub TimeDisplay_Change(newPacks As Long)
  174.     MP.CurrentPosition = newPacks / 100
  175. End Sub
  176.  
  177. Private Sub Timer1_Timer()
  178.     Dim mpos As Long, mvol As Long
  179.     If MP.Rate <> SlideSpeed.value / 100 Then MP.Rate = SlideSpeed.value / 100
  180.    
  181.     mvol = -(100 - SlideVolume.value) * 100     'Media Player volume = 0 (max) to -10000 (min)
  182.     If MP.Volume <> mvol Then MP.Volume = mvol
  183.    
  184.     mpos = Int(MP.CurrentPosition * 100)
  185.     If mpos >= VScroll.min And mpos <= VScroll.max And VScroll.value <> mpos Then
  186.         VScroll.value = mpos
  187.         DrawWaveData
  188.     End If
  189. End Sub
  190.  
  191.  
  192. '-------------------------------------------------
  193. ' Main drawing routine
  194. '-------------------------------------------------
  195. ' MoveToEx and LineTo are GDI functions, many
  196. ' times faster than their VB equivalents and
  197. ' just as easy to use
  198. '
  199. ' Picture containing the wave form is 400 wide
  200. ' so change this code to suit your needs
  201. '-------------------------------------------------
  202. Sub DrawWaveData()
  203.     Dim t1 As Long, vstart As Long, hline As Integer
  204.     vstart = VScroll.value
  205.    
  206.     'Make sure the cursor starts at the left, moves to the middle,
  207.     'then the waveform moves until at the end the cursor moves right
  208.     If vstart < 200 Or WavCount < 400 Then      'First 200
  209.         hline = vstart
  210.         vstart = 0
  211.     ElseIf vstart > WavCount - 200 Then         'Last 200
  212.         hline = vstart - WavCount + 400
  213.         vstart = WavCount - 400
  214.     Else                                        'Anything else
  215.         hline = 200
  216.         vstart = vstart - 200
  217.     End If
  218.     VScroll.topval = vstart
  219.    
  220.     PicWave.Cls
  221.     PicWave.ForeColor = vbGreen
  222.    
  223.     'Draw each line
  224.     For t1 = 0 To IIf(WavCount < 400, WavCount, 400)
  225.         MoveToEx PicWave.hdc, t1, WavMin(vstart + t1), LastPt
  226.         LineTo PicWave.hdc, t1, WavMax(vstart + t1)
  227.        
  228.         'Marks for 0.1 (small) and 1-second (large) intervals
  229.         If (vstart + t1) Mod 10 = 0 Then
  230.             MoveToEx PicWave.hdc, t1, 128, LastPt
  231.             LineTo PicWave.hdc, t1, IIf((vstart + t1) Mod 100 = 0, 100, 120)
  232.         End If
  233.     Next t1
  234.    
  235.     MoveToEx PicWave.hdc, 0, 64, LastPt 'Draw center line
  236.     LineTo PicWave.hdc, 400, 64
  237.    
  238.     PicWave.ForeColor = vbRed           'Draw cursor line
  239.     MoveToEx PicWave.hdc, hline, 0, LastPt
  240.     LineTo PicWave.hdc, hline, 500
  241.    
  242.     PicWave.Refresh
  243.    
  244.     LabStatus.Caption = VScroll.value & " of " & WavCount & " (" & WavCount / 100 & " seconds)"
  245.    ' TimeDisplay.SetVal VScroll.value
  246. End Sub


Ho controllato solo la sincronia... :heehee:
:k:

Ultima modifica effettuata da Carlo il 07/02/2021 alle 8:54


in programmazione tutto è permesso
PM Quote
Avatar
iz1kbp (Normal User)
Rookie


Messaggi: 26
Iscritto: 29/02/2020

Segnala al moderatore
Postato alle 20:33
Sabato, 06/02/2021
Grande Carlo,funziona regolarmente!!
Si, avevo capito il discorso della doppia assegnazione ma non riuscivo a capire, perchè non l'ho mai usato,il discorso dell'aggiornamento dinamico di una variabile e non dell'altra.
Certe finezze cognitive sono molto sopra il mio livello di conoscenze in vb6.:hail:
Ti ringrazio per l'aiuto e per la spiegazione.
A presto e grazie ancora.

Mario

:k:

PM Quote
Avatar
Carlo (Member)
Guru


Messaggi: 1315
Iscritto: 29/01/2018

Segnala al moderatore
Postato alle 21:02
Sabato, 06/02/2021
Roger iz1kbp
7351
passo in QRT
:rotfl:

Ultima modifica effettuata da Carlo il 07/02/2021 alle 8:31


in programmazione tutto è permesso
PM Quote
Pagine: [ 1 2 ] Precedente | Prossimo