Esempio n. 1
0
/** void midi::Out::openPort(int port, lua_State *L)
 * include/midi/Out.h:67
 */
static int Out_openPort(lua_State *L) {
  try {
    Out *self = *((Out **)dub_checksdata(L, 1, "midi.Out"));
    int type__ = lua_type(L, 2);
    if (type__ == LUA_TNUMBER) {
      int port = dub_checkint(L, 2);
      self->openPort(port, L);
      return 0;
    } else {
      const char *port_name = dub_checkstring(L, 2);
      self->openPort(port_name, L);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "openPort: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "openPort: Unknown exception");
  }
  return dub_error(L);
}