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

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

Handle the insertion of a new ImaegFrameTimeAxis

Parameters:
msg the received message

Definition at line 1124 of file imageframe_socket_handler.cc.

References sigc::bind(), get_message_part(), sigc::mem_fun(), VisualTimeAxis::NameChanged, send_imageframe_time_axis_removed(), send_imageframe_time_axis_renamed(), send_return_failure(), send_return_success(), thePublicEditor, and VisualTimeAxis::VisualTimeAxisRemoved.

Referenced by handle_insert_message().

{
      int position = 4 ; // message type chars
      
      // get the ImageFrameTrack name size
      int track_name_size = atoi(get_message_part(position, ardourvis::TEXT_SIZE_CHARS, msg).c_str()) ;
      position += ardourvis::TEXT_SIZE_CHARS ;
      
      // get the image frame track name
      std::string track_name = get_message_part(position, track_name_size, msg) ;
      position += track_name_size ;
      
      // check we dont already have an time axis with that name
      TimeAxisView* tav = thePublicEditor.get_named_time_axis(track_name) ;
      if(tav)
      {
            std::string errmsg("Track already exists: ") ;
            errmsg.append(track_name) ;
            send_return_failure(errmsg) ;
      }
      else
      {
            thePublicEditor.add_imageframe_time_axis(track_name, this) ;
            TimeAxisView* new_tav = thePublicEditor.get_named_time_axis(track_name) ;
      
            if(new_tav)
            {
                  ImageFrameTimeAxis* ifta = (ImageFrameTimeAxis*)new_tav ;
                  ifta->VisualTimeAxisRemoved.connect(sigc::mem_fun(*this, &ImageFrameSocketHandler::send_imageframe_time_axis_removed)) ;
                  ifta->NameChanged.connect(sigc::bind(sigc::mem_fun(*this, &ImageFrameSocketHandler::send_imageframe_time_axis_renamed), ifta)) ;
                  
                  send_return_success() ;
            }
            else
            {
                  std::string msg("Addition Failed: ") ;
                  msg.append(track_name) ; 
                  send_return_failure(msg) ;
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index