int main(int argc, char **argv) { Agraph_t *g; Agnode_t *n; ingraph_state ig; int i = 0; int code = 0; Dict_t *Q; init(argc, argv); newIngraph(&ig, Files, gread); Q = dtopen(&MyDisc, Dtoset); while ((g = nextGraph(&ig)) != 0) { dtclear(Q); if ((n = agnode(g, Nodes[i], 0))) dijkstra(Q, g, n); else { fprintf(stderr, "%s: no node %s in graph %s in %s\n", CmdName, Nodes[i], agnameof(g), fileName(&ig)); code = 1; } agwrite(g, stdout); fflush(stdout); agclose(g); i++; } exit(code); }
void MediaObject::switchFilters(int index, Filter oldFilter, Filter newFilter) { if (currentGraph()->index() == index) { currentGraph()->switchFilters(oldFilter, newFilter); } else { nextGraph()->switchFilters(oldFilter, newFilter); } }
void MediaObject::setNextSource(const Phonon::MediaSource &source) { m_nextSourceReadyToStart = true; const bool shouldSwitch = (m_state == Phonon::StoppedState || m_state == Phonon::ErrorState); nextGraph()->loadSource(source); //let's preload the source if (shouldSwitch) { switchToNextSource(); } }
int main(int argc, char **argv) { Agraph_t *g; ingraph_state ig; char **files; files = scanargs(argc, argv); newIngraph(&ig, files, gread); while ((g = nextGraph(&ig))) { transform(g); agwrite(g, outFile); } return 0; }
int main(int argc, char **argv) { Agraph_t *g; ingraph_state ig; init(argc, argv); newIngraph(&ig, Files, gread); while ((g = nextGraph(&ig)) != 0) { if (!chkOnly) agwrite(g, stdout); agclose(g); } return(ig.errors | agerrors()); }
int main(int argc,char **argv) { Agraph_t* g; ingraph_state ig; init (argc, argv); newIngraph (&ig, Files, gread); while ((g = nextGraph(&ig)) != 0) { agwrite(g,stdout); agclose (g); } exit(0); }
int main(int argc, char *argv[]) { Agraph_t *g; ingraph_state ig; int r = 0; int gcnt = 0; init(argc, argv); newIngraph(&ig, Files, gread); while ((g = nextGraph(&ig)) != 0) { r |= process(g, gcnt); agclose(g); gcnt++; } return r; }
int main(int argc, char **argv) { Agraph_t* g; ingraph_state ig; scanArgs(argc,argv); newIngraph (&ig, Files, gread); while ((g = nextGraph(&ig)) != 0) { if (agisdirected(g)) process (g); else fprintf (stderr, "Graph %s in %s is undirected - ignored\n", agnameof(g), fileName(&ig)); agclose (g); } return 0; }
int main(int argc, char *argv[]) { Agraph_t *g = 0, *prevg = 0; ingraph_state ig; opts_t opts; init(argc, argv, &opts); newIngraph (&ig, opts.infiles, gread); while ((g = nextGraph (&ig)) != 0) { if (prevg) agclose (prevg); clusterGraph (g, opts.maxcluster, opts.clustering_method); agwrite(g, opts.outfp); prevg = g; } return 0; }
void MediaObject::switchToNextSource() { m_prefinishMarkSent = false; m_aboutToFinishSent = false; m_nextSourceReadyToStart = false; m_oldHasVideo = currentGraph()->hasVideo(); qSwap(m_graphs[0], m_graphs[1]); //swap the graphs if (m_transitionTime >= 0) m_graphs[1]->stop(); //make sure we stop the previous graph if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid && catchComError(currentGraph()->renderResult())) { setState(Phonon::ErrorState); return; } //we need to play the next media play(); //we tell the video widgets to switch now to the new source #ifndef QT_NO_PHONON_VIDEO for (int i = 0; i < m_videoWidgets.count(); ++i) { m_videoWidgets.at(i)->setCurrentGraph(currentGraph()->index()); } #endif //QT_NO_PHONON_VIDEO emit currentSourceChanged(currentGraph()->mediaSource()); emit metaDataChanged(currentGraph()->metadata()); if (nextGraph()->hasVideo() != currentGraph()->hasVideo()) { emit hasVideoChanged(currentGraph()->hasVideo()); } emit tick(0); emit totalTimeChanged(totalTime()); #ifndef QT_NO_PHONON_MEDIACONTROLLER setTitles(currentGraph()->titles()); #endif //QT_NO_PHONON_MEDIACONTROLLER }
int main(int argc, char **argv) { Agraph_t *G; Agraph_t *prev = 0; int rv; ingraph_state ig; rv = 0; initargs(argc, argv); newIngraph(&ig, Files, gread); while ((G = nextGraph(&ig))) { if (prev) { id = 0; agclose(prev); } prev = G; gv_to_gml(G, outFile); fflush(outFile); } exit(rv); }
int main(int argc, char **argv) { Agraph_t *G; Agraph_t *prev = 0; initargs(argc, argv); if (act == ToGXL) { ingraph_state ig; newIngraph(&ig, Files, gread); while ((G = nextGraph(&ig))) { if (prev) agclose(prev); prev = G; gv_to_gxl(G, outFile); fflush(outFile); } } else { #ifdef HAVE_EXPAT FILE *inFile; while ((inFile = getFile())) { while ((G = gxl_to_gv(inFile))) { if (prev) agclose(prev); prev = G; agwrite(G, outFile); fflush(outFile); } } #else fputs("cvtgxl: not configured for conversion from GXL to GV\n", stderr); exit(1); #endif } exit(0); }
int main (int argc, char* argv[]) { Agraph_t* g; ingraph_state ig; int rv = 0; init (argc, argv); newIngraph (&ig, Files, agread); while ((g = nextGraph(&ig)) != 0) { fname = fileName(&ig); if (verbose) fprintf (stderr, "Process graph %s in file %s\n", g->name, fname); rv |= eval (g, 1); agclose (g); } if (n_graphs > 1) wcp (tot_nodes, tot_edges, tot_cc, tot_cl, "total", 0); return rv; }
void MediaObject::handleComplete(IGraphBuilder *graph) { if (graph == currentGraph()->graph()) { if (m_transitionTime >= PRELOAD_TIME || m_aboutToFinishSent == false) { emit aboutToFinish(); //give a chance to the frontend to give a next source m_aboutToFinishSent = true; } if (!m_nextSourceReadyToStart) { //this is the last source, we simply finish const qint64 current = currentTime(); const OAFilterState currentState = currentGraph()->syncGetRealState(); emit tick(current); //this ensures that the end of the seek slider is reached emit finished(); if (currentTime() == current && currentGraph()->syncGetRealState() == currentState) { //no seek operation in-between pause(); setState(Phonon::PausedState); //we set it here } } else if (m_transitionTime == 0) { //gapless transition switchToNextSource(); //let's call the function immediately } else if (m_transitionTime > 0) { //management of the transition (if it is >= 0) QTimer::singleShot(m_transitionTime, this, SLOT(switchToNextSource())); } } else { //it is just the end of the previous source (in case of cross-fading) nextGraph()->cleanup(); } for (int i = 0; i < m_audioOutputs.count(); ++i) { m_audioOutputs.at(i)->setCrossFadingProgress( currentGraph()->index(), 1.); //cross-fading is in any case finished } }
int main(int argc, char **argv) { int c; char *progname; ingraph_state ig; Agraph_t *graph; Agnode_t *node; Agedge_t *edge; Agedge_t *nexte; Agsym_t *attr; char **files; generic_list_t *attr_list; generic_list_t *node_list; unsigned long i, j; opterr = 0; progname = strrchr(argv[0], '/'); if (progname == NULL) { progname = argv[0]; } else { progname++; /* character after last '/' */ } attr_list = new_generic_list(16); node_list = new_generic_list(16); while ((c = getopt(argc, argv, "hvn:N:")) != -1) { switch (c) { case 'N': { attr_list = addattr(attr_list, optarg); break; } case 'n': { node_list = addnode(node_list, optarg); break; } case 'h': { help_message(progname); exit(EXIT_SUCCESS); break; } case 'v': { verbose = 1; break; } case '?': if (isprint(optopt)) { fprintf(stderr, "Unknown option `-%c'.\n", optopt); } else { fprintf(stderr, "Unknown option character `\\x%X'.\n", optopt); } exit(EXIT_FAILURE); break; default: help_message(progname); exit(EXIT_FAILURE); break; } } /* Any arguments left? */ if (optind < argc) { files = &argv[optind]; } else { files = NULL; } newIngraph(&ig, files, gread); while ((graph = nextGraph(&ig)) != NULL) { if (agisdirected(graph) == 0) { fprintf(stderr, "*** Error: Graph is undirected! Pruning works only with directed graphs!\n"); exit(EXIT_FAILURE); } /* attach node data for marking to all nodes */ aginit(graph, AGNODE, NDNAME, sizeof(ndata), 1); /* prune all nodes specified on the commandline */ for (i = 0; i < node_list->used; i++) { if (verbose == 1) fprintf(stderr, "Pruning node %s\n", (char *) node_list->data[i]); /* check whether a node of that name exists at all */ node = agnode(graph, (char *) node_list->data[i], 0); if (node == NULL) { fprintf(stderr, "*** Warning: No such node: %s -- gracefully skipping this one\n", (char *) node_list->data[i]); } else { MARK(node); /* Avoid cycles */ /* Iterate over all outgoing edges */ for (edge = agfstout(node); edge; edge = nexte) { nexte = agnxtout(edge); if (aghead(edge) != node) { /* non-loop edges */ if (verbose == 1) fprintf(stderr, "Processing descendant: %s\n", agnameof(aghead(edge))); remove_child(graph, aghead(edge)); agdelete(graph, edge); } } UNMARK(node); /* Unmark so that it can be removed in later passes */ /* Change attribute (e.g. border style) to show that node has been pruneed */ for (j = 0; j < attr_list->used; j++) { /* create attribute if it doesn't exist and set it */ attr = agattr(graph, AGNODE, ((strattr_t *) attr_list->data[j])->n, ""); if (attr == NULL) { fprintf(stderr, "Couldn't create attribute: %s\n", ((strattr_t *) attr_list->data[j])->n); exit(EXIT_FAILURE); } agxset(node, attr, ((strattr_t *) attr_list->data[j])->v); } } } agwrite(graph, stdout); agclose(graph); } free(attr_list); free(node_list); exit(EXIT_SUCCESS); }