#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9
dc.SetPen (*wxThePenList->FindOrCreatePen (wxColour (255, 255, 255), 0, wxPENSTYLE_SOLID));
#else
- dc.SetPen (*wxThePenList->FindOrCreatePen (wxColour (255, 255, 255), 0, SOLID));
+ dc.SetPen (*wxThePenList->FindOrCreatePen (wxColour (255, 255, 255), 0, wxSOLID));
#endif
dc.DrawRectangle (rect);
_grid->AutoSize ();
- wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
- s->Add (_grid, 1, wxEXPAND);
- SetSizerAndFit (s);
+ _sizer = new wxBoxSizer (wxVERTICAL);
+ _sizer->Add (_grid, 1, wxEXPAND | wxALL);
+ SetSizerAndFit (_sizer);
Connect (wxID_ANY, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler (AudioMappingView::left_click), 0, this);
}
} else {
_grid->SetCellValue (ev.GetRow(), ev.GetCol(), wxT("1"));
}
+
+ AudioMapping mapping;
+ for (int i = 0; i < _grid->GetNumberRows(); ++i) {
+ for (int j = 1; j < _grid->GetNumberCols(); ++j) {
+ if (_grid->GetCellValue (i, j) == wxT ("1")) {
+ mapping.add (i, static_cast<libdcp::Channel> (j - 1));
+ }
+ }
+ }
+
+ Changed (mapping);
}
void
-AudioMappingView::set_mapping (AudioMapping map)
+AudioMappingView::set (AudioMapping map)
{
if (_grid->GetNumberRows ()) {
_grid->DeleteRows (0, _grid->GetNumberRows ());
}
- list<AudioMapping::Channel> content_channels = map.content_channels ();
+ list<int> content_channels = map.content_channels ();
_grid->InsertRows (0, content_channels.size ());
for (size_t r = 0; r < content_channels.size(); ++r) {
}
int n = 0;
- for (list<AudioMapping::Channel>::iterator i = content_channels.begin(); i != content_channels.end(); ++i) {
- shared_ptr<const AudioContent> ac = i->content.lock ();
- assert (ac);
- _grid->SetCellValue (n, 0, wxString::Format (wxT("%s %d"), std_to_wx (ac->file().filename().string()).data(), i->index + 1));
+ for (list<int>::iterator i = content_channels.begin(); i != content_channels.end(); ++i) {
+ _grid->SetCellValue (n, 0, wxString::Format (wxT("%d"), *i + 1));
list<libdcp::Channel> const d = map.content_to_dcp (*i);
for (list<libdcp::Channel>::const_iterator j = d.begin(); j != d.end(); ++j) {
}
++n;
}
-
- _grid->AutoSize ();
}