|
Show the code that your 'myMp3.Write()' function expects when you write to it.
|
|
|
|
|
Hi...sorry for the late reply...i think what you want is this
myMp3.ID3v2Tag.Title = TextBox1.Text
myMp3.Write()
This is what i do..if:
i put this in the beginning of the code
Public Class Form1
Dim myMp3 As New UltraID3()
then use this to open and list the files:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
ListBox1.Items.Clear()
Dim fileNames = My.Computer.FileSystem.GetFiles(FolderBrowserDialog1.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly, "*.mp3")
For Each fileName As String In fileNames
Dim result As String = Path.GetFileName(fileName)
ListBox1.Items.Add(result)
Next
End If
Label1.Text = "Title :"
Label2.Text = "Artist :"
Label3.Text = "Album :"
Label4.Text = "Year :"
Label5.Text = "Track :"
Label6.Text = "Comment :"
Label7.Text = "Genre : "
End Sub
then this to read and extract the tags into the labels text:
<pre> Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
If ListBox1.SelectedItem = "" Then
On Error Resume Next
Else
myMp3.Read(FolderBrowserDialog1.SelectedPath & "\" & ListBox1.SelectedItem)
Label1.Text = "Title : " & myMp3.ID3v2Tag.Title
Label2.Text = "Artist : " & myMp3.ID3v2Tag.Artist
Label3.Text = "Album : " & myMp3.ID3v2Tag.Album
Label4.Text = "Year : " & myMp3.ID3v2Tag.Year.ToString
Label5.Text = "Track : " & myMp3.ID3v2Tag.TrackNum.ToString
Label6.Text = "Comment : " & myMp3.ID3v2Tag.Comments
Label7.Text = "Genre : " & myMp3.ID3v2Tag.Genre
On Error Resume Next
Dim pics = myMp3.ID3v2Tag.Frames.GetFrames(CommonMultipleInstanceID3v2FrameTypes.Picture)
PictureBox1.Image = CType(pics(0), ID3v2PictureFrame).Picture
End If
End Sub
and finally this code to write from textboxes into the file:
<pre>Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If ListBox1.SelectedItem = "" Then
Dim r8 As DialogResult = MessageBox.Show(Me, "No File Selected!",
"Select Files", MessageBoxButtons.OK)
Else
If CheckBox1.Checked = False And CheckBox2.Checked = False And CheckBox3.Checked = False And CheckBox4.Checked = False And CheckBox5.Checked = False And CheckBox6.Checked = False And CheckBox7.Checked = False And CheckBox8.Checked = False Then
Dim r8 As DialogResult = MessageBox.Show(Me, "Select a tag to enter!",
"Select Tags", MessageBoxButtons.OK)
Else
Dim fils = ListBox1.SelectedItems
For Each item In fils
If CheckBox1.Checked = True Then
myMp3.ID3v2Tag.Title = TextBox1.Text
myMp3.Write()
End If
If CheckBox2.Checked = True Then
myMp3.ID3v2Tag.Artist = TextBox2.Text
myMp3.Write()
End If
If CheckBox3.Checked = True Then
myMp3.ID3v2Tag.Album = TextBox3.Text
myMp3.Write()
End If
If CheckBox4.Checked = True And TextBox4.Text <> "" Then
On Error Resume Next
myMp3.ID3v2Tag.Year = Short.Parse(TextBox4.Text)
myMp3.Write()
End If
If CheckBox5.Checked = True And TextBox5.Text <> "" Then
On Error Resume Next
myMp3.ID3v2Tag.TrackNum = Short.Parse(TextBox5.Text)
myMp3.Write()
End If
If CheckBox6.Checked = True Then
myMp3.ID3v2Tag.Comments = TextBox6.Text
myMp3.Write()
End If
If CheckBox7.Checked = True Then
If ComboBox1.Text = "01 - User" Then
myMp3.ID3v2Tag.Genre = TextBox7.Text
myMp3.Write()
Else
myMp3.ID3v2Tag.Genre = ComboBox1.Text
myMp3.Write()
End If
End If
Next
End If
Dim r9 As DialogResult = MessageBox.Show(Me, "Operation Complete!",
"Tagged Files!", MessageBoxButtons.OK)
End If
End Sub
The thing LOADS and SAVES MP3 TAGs!!
i understand what the code does but im not able to generate it all...im more of a decoder then what i have from coder lo0l
|
|
|
|
|
OK ... and where is the requested code from 'myMp3.Write()' ?
|
|
|
|
|
I dont know what you mean...but does it requests: myMp3.ID3v2Tag.Title ...? For example
|
|
|
|
|
No ... what I mean is this :
myMp3.ID3v2Tag.Title = TextBox1.Text
myMp3.Write()
There is the call for the write ... and what I want to see is the code of that method ... that can't be so difficult ...
|
|
|
|
|
I do not know...im using a dll library...how shall i look? Sorry
|
|
|
|
|
If it is like allready mentioned and you are using a Library ... you don't have the Source-Code from it ?
It is impossible to help if you are not helping ... the mistake (i suppose) is how you use this Library ...
|
|
|
|
|
Also waiting for the requested '.Write'.
|
|
|
|
|
It's part of the third party library he is using. Questions like this just go straight over his head. His programming skills are mainly: Copy, Paste and Guess.
|
|
|
|
|
I suppose you are right ... but doesn't makes it better ...
|
|
|
|
|
If you really want to know, then read this entire thread. Alternatively find something interesting to waste your time on.
|
|
|
|
|
Yes im using the UltraID3lib library...i cannot access its code? Or...how do i do it?
Guys...about my knowledge..i have a book called Visual Basic 6 - Advanced Tecnichs with API...i have read the book and made a lot of small apps during "the day"...now my book is obsolete almost because of VB.Net being different..anyway..i learned all with that book and no more outside help...im trying to get back a little to VB just to excercise my mind...and..create a small application to give away in my website..
I code in SynthEdit some Virtual Synthesizers using a Visual Programming language..i also do all my website coding..
...and im no pro in none of these...but..i normally can achieve what i look for..
just for you to know my website: [DELETED]
|
|
|
|
|
I removed the URL to prevent you being tagged as a spammer (and it was that close whether I let it through without the URL or tagged it and you as spam) which would mean the BanHammer starts swinging. Please don't post it again, others are rather more trigger happy than I.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OK...thank you for not banning me
|
|
|
|
|
Oops ... I have done that ...
What kind of answer did you got from the OP that it is flagged as (I suppose) abusive ?
|
|
|
|
|
I need to say something that will make you laugh the rest of the day...
i was makin a .NET app...not an .NET Framework...how did i error this?!! lo0l
I already passed all code into a .NET Framework application
Sorry..if does matter?!!
|
|
|
|
|
Okay ... to be able to understand the problem YOU must understand how the Framework you are using is working.
I suppose that your problem comes from not using this Framework in the right way.
I, myself, don't like to use 3rd party products from which I don't know how to work with. Mostly it is easier (for me) to create it by myself ...
|
|
|
|
|
No, none of it is abusive. Just that he is copying stuff from the internet, and his understanding of what he copies, and general programming is not too good.
|
|
|
|
|
Message Closed
modified 15-Jun-23 8:16am.
|
|
|
|
|
I don't think you meant this message for me Andre.
|
|
|
|
|
Oops, no sorry. Will repost under the correct tab...
|
|
|
|
|
hey..i was able to do it...i used this code
<pre>Private Sub lblsave_Click(sender As Object, e As EventArgs) Handles lblsave.Click
If ListBox1.SelectedItem = "" Then
Dim r8 As DialogResult = MessageBox.Show(Me, "No file selected!",
"Select files!", MessageBoxButtons.OK)
Else
Dim rw As DialogResult = MessageBox.Show(Me, "SAVE all TAGs?",
"Save tags!", MessageBoxButtons.OKCancel)
If rw = DialogResult.OK Then
If CheckBox1.Checked = False And CheckBox2.Checked = False And CheckBox3.Checked = False And CheckBox4.Checked = False And CheckBox5.Checked = False And CheckBox6.Checked = False And CheckBox7.Checked = False And CheckBox8.Checked = False Then
Dim r8 As DialogResult = MessageBox.Show(Me, "Select a tag to enter!",
"Select tags!", MessageBoxButtons.OK)
Else
Dim ite = ListBox1.SelectedItems
For Each item In ite
myMp3.Read(FolderBrowserDialog1.SelectedPath & "\" & item)
If CheckBox1.Checked = True Then
myMp3.ID3v2Tag.Title = label1.Text
myMp3.Write()
End If
If CheckBox2.Checked = True Then
myMp3.ID3v2Tag.Artist = Label2.Text
myMp3.Write()
End If
If CheckBox3.Checked = True Then
myMp3.ID3v2Tag.Album = Label3.Text
myMp3.Write()
End If
If CheckBox4.Checked = True And Label4.Text <> "" Then
On Error Resume Next
myMp3.ID3v2Tag.Year = Short.Parse(Label4.Text)
myMp3.Write()
End If
If CheckBox5.Checked = True And label5.Text <> "" Then
On Error Resume Next
myMp3.ID3v2Tag.TrackNum = Short.Parse(label5.Text)
myMp3.Write()
End If
If CheckBox6.Checked = True Then
myMp3.ID3v2Tag.Comments = label6.Text
myMp3.Write()
End If
If CheckBox7.Checked = True Then
myMp3.ID3v2Tag.Genre = label7.Text
myMp3.Write()
End If
If CheckBox8.Checked = True Then
If label10.Text <> "" Then
Dim pics = myMp3.ID3v2Tag.Frames.GetFrames(CommonMultipleInstanceID3v2FrameTypes.Picture)
myMp3.ID3v2Tag.Frames.Remove(pics)
myMp3.Write()
Dim AlbumArt As ID3v2PictureFrame = New ID3v23PictureFrame(CType(System.Drawing.Bitmap.FromFile(label10.Text), System.Drawing.Bitmap), PictureTypes.CoverFront, "Attached picture", TextEncodingTypes.ISO88591)
myMp3.ID3v2Tag.Frames.Add(AlbumArt)
myMp3.Write()
Else
Dim re As DialogResult = MessageBox.Show(Me, "Could not write image!",
"Tagged files!", MessageBoxButtons.OK)
End If
End If
Next item
End If
End If
End If
Dim r9 As DialogResult = MessageBox.Show(Me, "Operation complete!",
"Tagged files!", MessageBoxButtons.OK)
End Sub
|
|
|
|
|
No that is definitely not the way to do it. You should set the tags as and when the user edits them*, and then save the entire set when he/she presses Save. The way you are doing it the user has no way to cancel the changes.
*You should not need all those checkboxes. Just use an event handler for when the user changes any of the tag entries. As I said yesterdsay, and as clearly demonstrated in your video, you are going about this whole project the wrong way. And until you step back and take on board some of the suggestions you have been given, and start utilising proper functions and subroutines, you will never get your "mass edit" to work.
|
|
|
|
|
|
The problem is that it does not returns any error...it simply does not perform the action required!
|
|
|
|