예제 #1
0
MantaFlextPoly::MantaFlextPoly(int argc, t_atom *argv) :
   StoredValue(-1)
{
   if(argc > 0 && CanbeInt(argv[0]))
   {
      /* Voices initialized to empty vector, so all items are new
       * and initialized to -1 */
      Voices.assign(GetInt(argv[0]), -1);
   }
   else
   {
      Voices.assign(48, -1);
   }
   /* voice stealing is not yet implemented */
   if(argc > 1 && CanbeInt(argv[1]))
   {
      Stealing = GetInt(argv[1]);
   }
   AddInAnything();
   AddInFloat();
   AddOutFloat();
   AddOutFloat();
   AddOutFloat();
   FLEXT_ADDMETHOD(0, PadHandler);
   FLEXT_ADDMETHOD(1, ValueHandler);
   FLEXT_ADDMETHOD(0, PadAndValueHandler);
}
예제 #2
0
파일: clk_client.cpp 프로젝트: jondf/pd
void Client::ms_name(int argc,const t_atom *argv)
{
    const t_symbol *n;
    if(!argc)
        n = NULL;
    else if(CanbeInt(*argv)) {
        // that's mainly for missing $-args which are set as 0
        char tmp[20];
        sprintf(tmp,"%i",GetAInt(*argv));
        n = MakeSymbol(tmp);
    }
    else
        n = GetSymbol(*argv);

    double current;
    if(LIKELY(clock)) {
        if(clock->name == n) return;

        current = clock->Current();

        Clock::Unregister(clock,this);
        clock = NULL;
    }
    else if(!n)
        return;
    else
        current = 0;

    if(LIKELY(n)) {
        clock = Clock::Register(n,this);
        offset += current-clock->Current();
    }
}