int main()
{
    // arrays de libros
    book bookArray[MAX_QTY];
    setBookStatus(bookArray,MAX_QTY,0);
    //________________________________________________

    // arrays de libros
    author authorArray[MAX_QTY];
    setAuthorStatus(authorArray,MAX_QTY,0);
    //________________________________________________


    // Alta de datos para testing
    setBook(bookArray,1,1,"What you need before you can learn C",1,777);
    setBook(bookArray,2,2,"Using a Compiler",2,33);
    setBook(bookArray,3,3,"A Taste of C",3,98);
    setBook(bookArray,4,4,"Why Learn C",1,876);

    setAuthor(authorArray,1,1,"Brian","Kernighan");
    setAuthor(authorArray,2,2,"Dennis","Ritchie");
    setAuthor(authorArray,3,3,"Linus","Torvalds");
    setAuthor(authorArray,4,4,"Richard","Stallman");
    //________________________________________________

    int option = 0;

    while(option != 4)
    {
        system("@cls||clear");
        printf("\n------------  MENU PRINCIPAL ------------");
        option = getInt("\n1 - ABM LIBROS \n2 - ABM AUTORES \n3 - LISTAR LIBROS\n4 - SALIR\n\n\n");
        switch(option)
        {
            case 1: // ABM LIBROS
                adminBooks(bookArray);
                break;
            case 2: // ABM AUTORES
                adminAuthors(authorArray);
                break;
            case 3: // LISTAR
                system("@cls||clear");
                showBookAuthorArray(bookArray,MAX_QTY,authorArray,MAX_QTY);
                getChar("\n\nENTER (para continuar)");

                break;

        }
    }


    return 0;
}
Пример #2
0
bool SmlAllModel::setData(const QModelIndex &index, const QVariant &value, int /* role */)
{
    if (index.column() == 0)
        return false;

    QModelIndex smlIdIndex = QSqlQueryModel::index(index.row(), 0);
    int smlId = data(smlIdIndex,0).toInt();

    clear();

    bool ok = true;
    switch (index.column()) {
    case 1:
        ok = setAuthor(smlId, value.toString());
        break;
    case 2:
        ok = setTitle(smlId, value.toString());
        break;
    case 3:
        ok = setPublisher(smlId, value.toString());
        break;
    }
    refresh();
    return ok;
}
BOOL AP_Win32Dialog_Annotation::_onCommand(HWND hWnd, WPARAM wParam, LPARAM /*lParam*/)
{
	WORD wId = LOWORD(wParam);

	switch (wId)
	{
		case IDCANCEL:
			setAnswer(a_CANCEL);
			EndDialog(hWnd,0);
			return 1;

		case IDOK:
		{
			std::string text;

			_get_text(AP_RID_DIALOG_ANNOTATION_EDIT_TITLE, text);
			setTitle(text);

			_get_text(AP_RID_DIALOG_ANNOTATION_EDIT_AUTHOR, text);
			setAuthor(text);

			_get_text(AP_RID_DIALOG_ANNOTATION_EDIT_DESCRIPTION, text);
			setDescription(text);

			setAnswer(a_OK);
			EndDialog(hWnd,0);
			return 1;
		}

		default:							// we did not handle this notification
			UT_DEBUGMSG(("WM_Command for id %ld\n",wId));
			return 0;						// return zero to let windows take care of it.
	}
}
Пример #4
0
bool QLCFixtureDef::loadCreator(QXmlStreamReader &doc)
{
    if (doc.name() != KXMLQLCCreator)
    {
        qWarning() << Q_FUNC_INFO << "file creator information not found!";
        return false;
    }

    while (doc.readNextStartElement())
    {
        if (doc.name() == KXMLQLCCreatorName)
        {
            /* Ignore name */
            doc.skipCurrentElement();
        }
        else if (doc.name() == KXMLQLCCreatorVersion)
        {
            /* Ignore version */
            doc.skipCurrentElement();
        }
        else if (doc.name() == KXMLQLCCreatorAuthor)
        {
            setAuthor(doc.readElementText());
        }
        else
        {
            qWarning() << Q_FUNC_INFO << "unknown creator tag:" << doc.name();
            doc.skipCurrentElement();
        }
    }

    return true;
}
void mgsRileyEllipsesAndSquares::setup() {
    setAuthor("Michael Simpson");
    setOriginalArtist("Bridget Riley");
    //- Hidden Squares - 1990");
    px0 = 66;
    py0 = 97;
    px1 = 260;
    py1 = 310;
    px2 = 320;
    py2 = 100;
    px3 = 440;
    py3 = 270;
    px4 = 69;
    py4 = 349;
    px5 = 320;
    py5 = 430;
    px6 = 330;
    py6 = 320;
    px7 = 434;
    py7 = 429;

    bNeedRedraw = false;

    parameters.add(unitSize.set("Unit Size", 6, 2, 8));
    unitSize.addListener(this, &mgsRileyEllipsesAndSquares::redraw);
    loadCode("scenes/mgsRileyEllipsesAndSquares/exampleCode.cpp");

    ofBackground(255);
    ofSetCircleResolution(100);
    frame.allocate(dimensions.width, dimensions.height, GL_RGB32F_ARB);
    frame.begin();
    ofClear(0);
    frame.end();
    drawScene();
}
Пример #6
0
bool BassDecoder::decodeOGGTag(){
  char* tags=const_cast<char*>(BASS_ChannelGetTags(_music, BASS_TAG_OGG));
  string_t field;
  string_t value;
  if (tags) {
    while (*tags) {
      unsigned int size=strlen(tags);
      if (OggVorbisFileDecoder::splitComment(tags,size,field,value))
      {
#ifdef STRING_T_IS_SF_STRING
        sf::String::Iterator it;
        for (it=field.begin(); it !=field.end(); it++)
        {
          *it=toupper(*it);
        }
#endif
        if (field==string_t("TITLE"))
        {
          setName(value);
          return true;
        }
        else if (field==string_t("ARTIST"))
        {
          setAuthor(value);
          return true;
        }
      }
      tags+=strlen(tags)+1;
    }
  }
  return false;
}
Пример #7
0
ChannelMessage::ChannelMessage(MessagePacket packet)
  : Message(packet->id(), QByteArray(), LS("channel"), LS("addChannelMessage"))
  , m_packet(packet)
{
  setDate(m_packet->date());
  setAuthor(m_packet->sender());
  m_tab = detectTab(m_packet->sender(), m_packet->dest());

  if (!m_packet->internalId().isEmpty())
    m_data.insert(kInternalId, ChatId(m_packet->internalId()).toString());

  m_data.insert(kCommand,   packet->command());
  m_data.insert(kDirection, m_packet->sender() == ChatClient::id() ? kOutgoing : kIncoming);

  /// Если это собственное сообщение, то для него при необходимости устанавливается
  /// статус "offline" или "rejected".
  const int status = packet->status();
  if (isOffline(status))
    m_data.insert(kStatus, kOffline);
  else if (status != Notice::OK && status != Notice::Found && status < Notice::UserStatus)
    m_data.insert(kStatus, kRejected);

  if (status == MessageNotice::Removed) {
    m_data.insert(kStatus, kRemoved);
    m_data.insert(kText, QString(LS("<span class='message-removed' data-tr='message-removed'>%1</span> <i class='message-trash'></i>")).arg(WebBridge::i()->translate("message-removed")));
  }
  else
    m_data.insert(kText, TokenFilter::filter(LS("channel"), packet->text(), 0, packet->id()));

  if (!packet->oid.isNull()) {
    m_data.insert(kOID, QString(ChatId::toBase32(packet->oid.byteArray())));
    m_data.insert(kMDate, packet->mdate);
  }
}
Пример #8
0
void manfredMohrP196A::setup(){

	zeroVector = ofVec4f(0., 0., 0., 0.);

	orthoCam = ofCamera();
	//Manfred Mohr commonly used an orthographic perspective
	orthoCam.enableOrtho();
	//push out clipping planes so we don't cut off the geometry
	orthoCam.setFarClip(1000);
	orthoCam.setNearClip(-1000);
  
// setup pramaters
//    param.set("param", 5, 0, 100);
//    parameters.add(param);
	cubeARotationPercent.set("cubeARotationPercent", 0., 0., 1.);
	cubeBRotationDiffPercent.set("cubeBRotationDiffPercent", 0., 0., 1.);
	cubeOthersRotationDiffPercent.set("cubeOthersRotationDiffPercent", 0., 0., 1.);
	scaleParam.set("scale", 0.8, 0, 1);
	whiteBackground.set("whiteBackground", true);
	rearLineOpacity.set("rearLineOpacity", 0, 0, 255);
	//~1.75 spacing is the smallest before overlap starts occuring
	spacing.set("spacing", 2, 1.75, 10);
	parameters.add(cubeARotationPercent);
	parameters.add(cubeBRotationDiffPercent);
	parameters.add(cubeOthersRotationDiffPercent);
	parameters.add(scaleParam);
	parameters.add(whiteBackground);
	parameters.add(rearLineOpacity);
	parameters.add(spacing);

    setAuthor("Quin Kennedy");
    setOriginalArtist("Manfred Mohr");
    loadCode("scenes/manfredMohrP196A/exampleCode.cpp");
}
void yeseulMenkmanInstitution::setup(){
    
    for (int i=0; i<7000; i++) {
        for (int j=0; j<11; j++) {
            patternRandomArray[i][j] = int(ofRandom(1, 11));
        }
    }
    
    for (int i=0; i<5000; i++) {
        patternRandomNumberArray[i] = int(ofRandom(1, 11));
    }
    
    for(int i=0; i<324; i++) {
        squareRandomArray[i] = int(ofRandom(0, 10));
    }
    
    parameters.add(amountOfSquares.set("amountOfSquares", 2, 0, 5));
    parameters.add(numberOfBricks.set("numberOfBricks", 118, 0, 475));
    
    setAuthor("Yeseul Song");
    setOriginalArtist("Rosa Menkman");
    loadCode("scenes/yeseulMenkmanInstitution/exampleCode.cpp");
    
    
}
void alexLissamojiWhitney::setup(){
  
    ofBackground(0);
    // ofEnableSmoothing();
    center.set(dimensions.width*0.5, dimensions.height*0.5, 0);
    
    // Removing for black-on-white aesthetic
    // bckgImg.loadImage("scenes/alexLissamojiWhitney/back.png");
    
    // To Do: flip through all emojis in the folder ?
//    eyesImg.load("scenes/alexLissamojiWhitney/emojis/1f440.png");
    
    emojiSheet.load("scenes/alexLissamojiWhitney/sheet_32.png");
    
    anim[0] = 0;
    anim[1] = 0;
    

    // setup pramameters
    parameters.add(pAmp.set( "Amplitude", 200, 10, 400 ));
    // parameters.add(pFreq[1].set( "Frequency ", 1, 1, 10 ));
    pPhase.set("Phase", PI / 2 ,0,TWO_PI);
    parameters.add(pDensity.set("Density", 140, 0, 200));
    parameters.add(plissajouRatioX.set("Lissajous Ratio X", 2, 1, 3));
    parameters.add(plissajouRatioY.set("Lissajous Ratio Y", 3, 1, 3));
    pAnimSpeed.set("Animation Speed", 10, 1, 60);
    pImgScale.set("Image scale", 0.15, 0.0, 1);
    
    timerLastTime = ofGetElapsedTimeMillis();

    setAuthor("Alex Tolar");
    setOriginalArtist("John Whitney");
    loadCode("scenes/alexLissamojiWhitney/exampleCode.cpp");
}
Пример #11
0
void cantusFirmusRiley::setup(){
    ofBackground(255);
    size = 5000;
    
    y.c.setHex(0xA79C26);
    y.width = 9;
    
    p.c.setHex(0xC781A8);
    p.width = 9;
    
    b.c.setHex(0x64A2C9);
    b.width = 11;
    
    k.c.setHex(0x222B32);
    k.width = 39;
    
    w.c.setHex(0xE3E2DE);
    w.width = 29;
    
    g.c.set(127);
    g.width = 29;
    
    r.c.set(255,0,0);
    r.width = 10;
    
    int counter = 0;
    
    for (int i = 0; i <= size; i++){
        if(i == size/2) stripes.push_back(w);
        
        else if(abs(i-size/2)% 8 == 1) stripes.push_back(y);
        else if(abs(i-size/2)% 8 == 2) stripes.push_back(p);
        else if(abs(i-size/2)% 8 == 3) stripes.push_back(b);
        
        else if(abs(i-size/2)% 8 == 5) stripes.push_back(b);
        else if(abs(i-size/2)% 8 == 6) stripes.push_back(p);
        else if(abs(i-size/2)% 8 == 7) stripes.push_back(y);
        
        else if(abs(i-size/2)%12 == 0) stripes.push_back(w);
        else if(abs(i-size/2)%12 == 8) stripes.push_back(k);
        
        else if(abs(i-size/2)%12 == 4) {
            int rand = ofRandom(120,180);
            g.c.set(rand);
        //    cout << rand << endl;
            stripes.push_back(g);
        }
        
        else stripes.push_back(r);
    }

    parameters.add(posNoiseSpeed.set("offsetX", 0, -300, 300));
    parameters.add(zoomNoiseSpeed.set("zoom", 0.2, 0.05, 1));
    //parameters.add(range.set("scale", 0.3, 0.02, 1.0));

    setAuthor("Reed Tothong");
    setOriginalArtist("Bridget Riley");
    loadCode("scenes/cantusFirmusRiley/cantusFirmusRiley.cpp");
}
BookRecord::BookRecord(string title, string author, string publisher, int ISBN)
{

	setTitle(title);
	setAuthor(author);
	setPublisher(publisher);
	setISBN(ISBN);

}
Пример #13
0
void NewBook::on_buttonBox_accepted()
{
    setName(ui->nameEdit->text());
    setAuthor(ui->authorEdit->text());
    setIsbn(ui->isbnEdit->text());
    setQuantity(ui->quantityEdit->text());
    setAvailable(ui->availableEdit->text());
    setStudentid(ui->studentidEdit->text());
}
Пример #14
0
PMLibraryHandle::PMLibraryHandle( const QString& path )
{
   setPath( path );
   setAuthor( i18n( "Unknown" ) );
   setName( i18n( "Unknown" ) );
   m_objects.setAutoDelete( true );
   m_libraries.setAutoDelete( true );
   loadLibraryInfo( );
}
Пример #15
0
PMLibraryHandle::PMLibraryHandle( )
{
   setPath( "" );
   setAuthor( i18n( "Unknown" ) );
   setName( i18n( "Unknown" ) );
   m_readOnly = false;
   m_objects.setAutoDelete( true );
   m_libraries.setAutoDelete( true );
}
Пример #16
0
ServiceMessage::ServiceMessage(const QString &text, const QByteArray &user)
  : Message(ChatCore::randomId())
{
  m_data.insert(kType, LS("service"));
  m_data.insert(kText, text);
  m_data.insert(kDate, ChatClient::date());
  m_data.insert(kFunc, LS("addServiceMessage"));

  setAuthor(user);
}
Пример #17
0
void ForumMessage::copyFrom(ForumMessage * o) {
    setId(o->id());
    setOrdernum(o->ordernum());
    setUrl(o->url());
    setName(o->name());
    setAuthor(o->author());
    setLastchange(o->lastchange());
    setBody(o->body());
    setRead(o->isRead(), false);
}
Пример #18
0
//copy constructor for the text object
text::text(const text &textSource){

    //copy all of the items over from the source to the
    //current object
    setTitle(textSource.getTitle());
    setAuthor(textSource.getAuthor());
    setRating(textSource.getRating());
    setKeyword(textSource.getKeyword());
    strcpy(response, textSource.getResponse());
   
}
Пример #19
0
void olegVeraV::setup(){
  
    parameters.add(elementsAmount.set("elementsAmount", 25, 1, 36));
    parameters.add(thickness.set("thickness", 4, 0.001, 100));
    parameters.add(thicknessMultiplier.set("thicknessMultiplier", 1.01, 0.9, 1.1));
    parameters.add(curveHeight.set("heartBeat", 5, 1, 100));

    setAuthor("Oleg Pashkovsky");
    setOriginalArtist("Vera Molnar");
    loadCode("scenes/olegVeraV/exampleCode.cpp");
}
Пример #20
0
void MusicDecoders::_transmitInfos()
{
  //if (_currentDecoder)
  assert(_currentDecoder);
  {
    setName(_currentDecoder->name());
    setAuthor(_currentDecoder->author());
    _genre=_currentDecoder->genre();
    _sampleRate=_currentDecoder->sampleRate();
    _decodername=_currentDecoder->decoder();
  }
}
Пример #21
0
/*
----------------------------------setSearchData------------------------------
setSearchData - Sets information about an item, from a file formatted
                specifically containing action information.  This does
                not provide full details for a complete YouthBook.  It
                only allows for an item to be created with specific search
                criteria.

PreConditions: A validly formatted input file
PostConditions: Book information is updated from the file.
*/
bool YouthBook::setSearchData(std::ifstream& infile) {
    std::string inputAuthor, inputTitle;

    infile.get();
    getline(infile, inputTitle, FIELD_SEPARATOR);
    infile.get();
    getline(infile, inputAuthor, FIELD_SEPARATOR);
    setAuthor(inputAuthor);
    setName(inputTitle);

    //getline(infile, inputTitle);
    return true;
}
Пример #22
0
bool MusicDecoder::open(const string_t& filename){
  reset();
  bool r=this->_open(filename);
  if (r) {
    _filename=filename;
    while (string_t_find_success(_filename.find('/')))
      _filename.erase(0,_filename.find('/')+1);
    while (string_t_find_success(_filename.find('\\')))
      _filename.erase(0,_filename.find('\\')+1);
    
    
    //detect author and name from filename
    string_t partist;
    string_t pname;
    
    #if defined(SFML_STRING_HPP) 
    if (string_t_find_success(_filename.find('-')))
    {
      partist=_filename;
      pname=_filename;
      pname.erase(0,pname.find('-')+1);
      partist.erase(partist.find('-'), string_t_size(partist));
      
      remove_file_extension(pname);
      
      //Remove useless spaces and '_'
      remove_useless_spaces_before(pname);
      remove_useless_spaces_after(pname);
      
      //Detect track number from filename 
      remove_track_number(partist);
      remove_useless_spaces_after(partist);
      
    }
    else {
      //Identifying filename as title
      pname=_filename;
      remove_file_extension(pname);
      remove_track_number(pname);
      remove_useless_spaces_after(pname);
    }
    #endif
    
    if (string_t_empty(_name))
      setName(pname);
    if (string_t_empty(_artist))
      setAuthor(partist);
  }
  else _infosreset();
  return r;
}
Пример #23
0
void veraFscene::setup(){
    
    //parameters.add(numberOfF.set("numberOfF", 4, 4, 50));
    numberOfF = 40;
    parameters.add(frequency.set("frequency", 0.0, 0.0, 0.5));
    parameters.add(margin.set("margin", 4, 0, 10));
    parameters.add(lineWidth.set("lineWidth", 2, 0, 10));
    parameters.add(zoom.set("zoom", 1, 0.66667, 3));
    lastValue = 0;
    
    setAuthor("Becca Moore");
    setOriginalArtist("Vera Molnar");
    loadCode("scenes/veraFscene/exampleCode.cpp");
}
Пример #24
0
	/**
	 * \cond INTERNAL_DOCUMENTATION
	 */
	PropagatorPlugin::PropagatorPlugin(Plugin *_plugin)
	{
		plugin = _plugin;

		DynLib* handle = plugin->getHandle();
		proc_init = (pluginInitFunction)(handle->loadFunction("OPI_Plugin_init", true));
		if(proc_init)
		{
			proc_init(this);
		}
		proc_propagate = (pluginPropagateFunction)(handle->loadFunction("OPI_Plugin_propagate", true));
		setName(plugin->getName());
		setAuthor(plugin->getAuthor());
		setDescription(plugin->getDescription());
	}
Пример #25
0
bool BassDecoder::decodeID3v1()
{
  const char* tags=BASS_ChannelGetTags(_music, BASS_TAG_ID3);
  if (tags) {
    TAG_ID3 *id3=(TAG_ID3*)tags;
    char buf[31]={0};
    sprintf(buf,"%.30s",id3->title);
    setName(string_t(buf));
    sprintf(buf,"%.30s",id3->artist);
    setAuthor(string_t(buf));
    //setGenre(id3->genre);
    return true;
  }
  return false;
}
Пример #26
0
bool MusicDecoder::parseComment(
    const string_t& field,
    const string_t& value)
{
  if (field==string_t("TITLE"))
  {
    setName(value);
    return true;
  }
  else if (field==string_t("ARTIST"))
  {
    setAuthor(value);
    return true;
  }
  return false;
}
/*
----------------------------------setSearchData------------------------------
setSearchData - Sets information about an item, from a file formatted
                specifically containing action information.  This does
                not provide full details for a complete FictionBook.  It
                only allows for an item to be created with specific search
                criteria.

PreConditions: A validly formatted input file
PostConditions: Book information is updated from the file.
*/
bool FictionBook::setSearchData(std::ifstream& infile) {
    std::string inputAuthor, inputTitle;

    //Parsing the file, getting the information
    infile.get();
    getline(infile, inputAuthor, FIELD_SEPARATOR);
    infile.get();
    getline(infile, inputTitle, FIELD_SEPARATOR);

    //Setting the values on the FictionBook object
    setAuthor(inputAuthor);
    setName(inputTitle);

    //Always returns true.
    return true;
}
Пример #28
0
int Message::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 3)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 3;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 3)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 3;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = author(); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setAuthor(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 1;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 1)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 1;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Пример #29
0
SkinListItem::SkinListItem(KListView* parent, const QString& fancy_name,
    const QString& author, const QPixmap& icon, const QString& name, const QString& dir)
    : KListViewItem(parent, fancy_name)
{
    setName(name);
    setAuthor(author);
    setDir(dir);

    QString fancy_author = i18n("by %1").arg(author);
    QString text = QString("<qt><b>%1</b><br>%2</qt>").arg(fancy_name).arg(fancy_author);

    item_text = new QSimpleRichText(text, listView()->font());
    item_text->adjustSize();

    setPixmap(0, icon);

}
Пример #30
0
void Book::checkAuthor()
{
	std::string input = "";

	while (true) {
		std::cout << "Please enter the name of the author and press enter: ";
		std::getline(std::cin, input);

		if (input.length() >= 1) {
			break;
		}

		std::cout << "Invalid character, please try again" << std::endl;
	}
	std::cout << std::endl;
	std::cout << "You entered: " << input << std::endl;
	setAuthor(input);
}