

Then to add data to the control, you would do something like this: void Browser::OnClickDirCtrl(wxCommandEvent& event)ĭata.push_back(wxString::Format("%d",Channels)) ĭata.push_back(wxString::Format("%d",LengthSec)) ĭata.push_back(wxString::Format("%d",SampleRate)) ĭata.push_back(wxString::Format("%d",Bitrate)) Return wxString::FromUTF8(in.toCString(true)) wxString TagLibTowx(const TagLib::String& in) In order to add data to the control, you'll first need a utility function to convert TagLib strings to wxStrings. Be sure to change it to the name you're using. I'm also using m_dataViewListCtrl for the name of the control. M_dataViewListCtrl->AppendTextColumn("Comment") Įven though things like Channels and Bitrate are numbers, since wxDataViewListCtrl only offers a few types of columns, I'm guessing that text was used. M_dataViewListCtrl->AppendTextColumn("Bitrate") M_dataViewListCtrl->AppendTextColumn("SampleRate") M_dataViewListCtrl->AppendTextColumn("Length")

M_dataViewListCtrl->AppendTextColumn("Channels") M_dataViewListCtrl->AppendTextColumn("Artist") M_dataViewListCtrl->AppendTextColumn("Title") Int SampleRate = dioProperties()->sampleRate() ĭata.push_back() īased on the way you're trying to add data to the list view, I'm assuming that the columns were set up something like this: m_dataViewListCtrl->AppendToggleColumn("Fav") Int LengthSec = dioProperties()->lengthInSeconds() Int Length = dioProperties()->lengthInMilliseconds() Int Channels = dioProperties()->channels() Int Bitrate = dioProperties()->bitrate() TagLib::String Comment = File.tag()->comment() TagLib::String Title = File.tag()->title() TagLib::String Genre = File.tag()->genre() TagLib::String Album = File.tag()->album() TagLib::String Artist = File.tag()->artist() TagLib::FileRef File (DirCtrl->GetFilePath()) The application looks like this (this is from me tying it out in python)Īnd the function I have to add the data to DataViewListCtrl in C++ void Browser::OnClickDirCtrl(wxCommandEvent& event) I'm having some trouble figuring out how do I add the data to the DataViewListCtrl I did something similar in python recently, and python used a 2D list, to add data to it. I'm trying to make a application for managing audio sample library using wxWidgets, I have a DirCtrl on left and a DataViewListCtrl on right, when user navigates to a folder and double clicks on a file it should extract its tags and audio properties using taglib and add them to specific columns.
