cwPresetSel.h : Updated comments. Fixed bug in delete_fragment().
This commit is contained in:
parent
f57ac5ef3e
commit
8e1f7af04c
@ -637,29 +637,27 @@ cw::rc_t cw::preset_sel::create_fragment( handle_t h, unsigned end_loc, time::sp
|
|||||||
cw::rc_t cw::preset_sel::delete_fragment( handle_t h, unsigned fragId )
|
cw::rc_t cw::preset_sel::delete_fragment( handle_t h, unsigned fragId )
|
||||||
{
|
{
|
||||||
preset_sel_t* p = _handleToPtr(h);
|
preset_sel_t* p = _handleToPtr(h);
|
||||||
frag_t* f0 = nullptr;
|
frag_t* f = p->fragL;
|
||||||
frag_t* f1 = p->fragL;
|
|
||||||
|
|
||||||
for(; f1!=nullptr; f1=f1->link)
|
for(; f!=nullptr; f=f->link)
|
||||||
|
if( f->fragId == fragId )
|
||||||
{
|
{
|
||||||
if( f1->fragId == fragId )
|
if( f->prev == nullptr )
|
||||||
{
|
p->fragL = f->link;
|
||||||
if( f0 == nullptr )
|
|
||||||
p->fragL = f1->link;
|
|
||||||
else
|
else
|
||||||
f0->link = f1->link;
|
f->prev->link = f->link;
|
||||||
|
|
||||||
|
if( f->link != nullptr )
|
||||||
|
f->link->prev = f->prev;
|
||||||
|
|
||||||
// release the fragment
|
// release the fragment
|
||||||
mem::release(f1->presetA);
|
mem::release(f->presetA);
|
||||||
mem::release(f1);
|
mem::release(f);
|
||||||
|
|
||||||
return kOkRC;
|
return kOkRC;
|
||||||
}
|
}
|
||||||
|
|
||||||
f0 = f1;
|
return cwLogError(kInvalidArgRC,"The fragment '%i' could not be found to delete.",fragId);
|
||||||
}
|
|
||||||
|
|
||||||
return kOkRC;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cw::preset_sel::is_fragment_loc( handle_t h, unsigned loc )
|
bool cw::preset_sel::is_fragment_loc( handle_t h, unsigned loc )
|
||||||
|
@ -85,7 +85,10 @@ namespace cw
|
|||||||
|
|
||||||
bool is_fragment_loc( handle_t h, unsigned loc );
|
bool is_fragment_loc( handle_t h, unsigned loc );
|
||||||
|
|
||||||
|
// Return the fragment id of the 'selected' fragment.
|
||||||
unsigned ui_select_fragment_id( handle_t h );
|
unsigned ui_select_fragment_id( handle_t h );
|
||||||
|
|
||||||
|
// Set the 'select_flag' on this fragment and remove it from all others.
|
||||||
void ui_select_fragment( handle_t h, unsigned fragId, bool selectFl );
|
void ui_select_fragment( handle_t h, unsigned fragId, bool selectFl );
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user