Logo Search packages:      
Sourcecode: ardour version File versions  Download package

void ImageFrameSocketHandler::handle_item_selected ( const char *  msg  )  [private]

Handle the selection of an Item

Parameters:
msg the received message

Definition at line 1038 of file imageframe_socket_handler.cc.

References decompose_imageframe_item_desc(), get_message_part(), ImageFrameTimeAxisView::get_named_imageframe_group(), ImageFrameTimeAxisGroup::get_named_imageframe_item(), ImageFrameTimeAxis::get_view(), send_return_failure(), send_return_success(), TimeAxisViewItem::set_selected(), ImageFrameTimeAxisView::set_selected_imageframe_view(), and thePublicEditor.

Referenced by image_socket_callback().

{
      // determine the object that requires updating, characters 2-3
      std::string oType = get_message_part(2,2,msg) ;
      
      if(oType == std::string(ardourvis::IMAGEFRAME_ITEM))
      {
            int position = 4 ; // message type chars
      
            std::string track_id ;
            std::string scene_id ;
            std::string item_id ;
            int track_id_size ;
            int scene_id_size ;
            int item_id_size ;
      
            this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
            
            // get the named time axis
            ImageFrameTimeAxis* ifta = dynamic_cast<ImageFrameTimeAxis*>(thePublicEditor.get_named_time_axis(track_id)) ;
            
            if(!ifta)
            {
                  send_return_failure(std::string("No parent Image Track found : ").append(track_id)) ;
            }
            else
            {
                  // get the parent scene
                  ImageFrameTimeAxisGroup* iftag = ifta->get_view()->get_named_imageframe_group(scene_id) ;
                  if(!iftag)
                  {
                        send_return_failure(std::string("No parent Scene found : ").append(scene_id)) ;
                  }
                  else
                  {
                        ImageFrameView* ifv = iftag->get_named_imageframe_item(item_id) ;
                        if(!ifv)
                        {
                              send_return_failure(std::string("No Image Frame Item found : ").append(item_id)) ;
                        }
                        else
                        {
                              ifv->set_selected (true);
                              ifta->get_view()->set_selected_imageframe_view(iftag, ifv) ;

                              thePublicEditor.scroll_timeaxis_to_imageframe_item(ifv) ;
                              send_return_success() ;
                        }
                  }
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index